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