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