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