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