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->title(trans('$manufacturer::$car_model.names')) ->view('$manufacturer::public.car_model.index') ->data(compact('$car_models')) ->output(); } /** * Show car_model's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $car_models = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$manufacturer::$car_model.names')) ->view('$manufacturer::public.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->title($$car_model->name . trans('$manufacturer::$car_model.name')) ->view('$manufacturer::public.car_model.show') ->data(compact('$car_model')) ->output(); } }