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