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