Arcanedev\LogViewer\Contracts\LogViewer::entries PHP Method

entries() public method

Get the log entries.
public entries ( string $date, string $level = 'all' ) : Arcanedev\LogViewer\Entities\LogEntryCollection
$date string
$level string
return Arcanedev\LogViewer\Entities\LogEntryCollection
    public function entries($date, $level = 'all');

Usage Example

 /**
  * Filter the log entries by date and level.
  *
  * @param  string  $date
  * @param  string  $level
  *
  * @return \Illuminate\View\View|\Illuminate\Http\RedirectResponse
  */
 public function showByLevel($date, $level)
 {
     $this->authorize(LogViewerPolicy::PERMISSION_SHOW);
     $log = $this->getLogOrFail($date);
     if ($level == 'all') {
         return redirect()->route('foundation::system.log-viewer.logs.show', [$date]);
     }
     $levels = $this->logViewer->levelsNames();
     $entries = $this->logViewer->entries($date, $level)->paginate($this->perPage);
     $this->addBreadcrumbRoute('Logs List', 'foundation::system.log-viewer.logs.list');
     $this->addBreadcrumbRoute($date, 'foundation::system.log-viewer.logs.show', [$date]);
     $this->addBreadcrumb(ucfirst($level));
     $this->setTitle($date . ' | ' . ucfirst($level));
     return $this->view('system.log-viewer.show', compact('log', 'levels', 'entries'));
 }