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