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