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