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