/**
* 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'));
}