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