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