/** * Passing $from, $to, $total to view * @return mixed */ protected function getViewData() { $paginator = $this->grid->getConfig()->getDataProvider()->getPaginator(); $from = $paginator->getFrom(); $to = $paginator->getTo(); $total = $paginator->getTotal(); return parent::getViewData() + compact('from', 'to', 'total'); }
/** * Passing $from, $to, $total to view * @return mixed */ protected function getViewData() { $paginator = $this->grid->getConfig()->getDataProvider()->getPaginator(); # Laravel 4 if (method_exists($paginator, 'getFrom')) { $from = $paginator->getFrom(); $to = $paginator->getTo(); $total = $paginator->getTotal(); # Laravel 5 } else { $from = $paginator->firstItem(); $to = $paginator->lastItem(); $total = $paginator->total(); } return parent::getViewData() + compact('from', 'to', 'total'); }
protected function getViewData() { return parent::getViewData() + ['column' => $this->column]; }