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