Arcanedev\LogViewer\Contracts\LogViewer::statsTable PHP Method

statsTable() public method

Get logs statistics table.
public statsTable ( string | null $locale = null ) : StatsTable
$locale string | null
return Arcanedev\LogViewer\Tables\StatsTable
    public function statsTable($locale = null);

Usage Example

コード例 #1
0
 /**
  * List all logs.
  *
  * @param  \Illuminate\Http\Request  $request
  *
  * @return \Illuminate\View\View
  */
 public function listLogs(Request $request)
 {
     $this->authorize(LogViewerPolicy::PERMISSION_LIST);
     $stats = $this->logViewer->statsTable();
     $headers = $stats->header();
     // $footer   = $stats->footer();
     $page = $request->get('page', 1);
     $offset = $page * $this->perPage - $this->perPage;
     $rows = new LengthAwarePaginator(array_slice($stats->rows(), $offset, $this->perPage, true), count($stats->rows()), $this->perPage, $page);
     $rows->setPath($request->url());
     $this->setTitle($title = 'Logs List');
     $this->addBreadcrumb($title);
     return $this->view('admin.system.log-viewer.list', compact('headers', 'rows', 'footer'));
 }