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