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