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