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