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