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