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