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