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