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