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