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