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