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