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