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