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