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