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