model === null) { throw new Exception('Requires $model to be set or query() method to be overridden'); } return $this->model::query(); } abstract protected function columns() : array; protected function search(Builder $builder, string $search) : void {} protected function filters() : array { return []; } protected buildQuery() : Builder { $query = $this->query(); } public function render() { $this->buildQuery()->paginate(); $data = $query->paginate($this->pageSize); $columns = $this->columns(); return view('laralight-tables::table', compact( 'data', 'columns' )); } }