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