repository = $column; parent::__construct(); } /** * Show column's list. * * @param string $slug * * @return response */ protected function index() { $columns = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$timesheet::$column.names')) ->view('$timesheet::public.column.index') ->data(compact('$columns')) ->output(); } /** * Show column's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $columns = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$timesheet::$column.names')) ->view('$timesheet::public.column.index') ->data(compact('$columns')) ->output(); } /** * Show column. * * @param string $slug * * @return response */ protected function show($slug) { $column = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$column->name . trans('$timesheet::$column.name')) ->view('$timesheet::public.column.show') ->data(compact('$column')) ->output(); } }