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