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