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