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