search; $pageLimit = $request->input('pageLimit', config('database.pagination.limit')); $page = Coupon::pushScope(new RequestScope()) ->pushScope(new CouponPublicScope()) ->paginate($pageLimit) ->withQueryString(); $coupons = new CouponsCollection($page); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('coupon::coupon.names')) ->view('coupon::public.coupon.index') ->data(compact('coupons', 'categories', 'tags', 'recent')) ->output(); } /** * Show coupon. * * @param string $slug * * @return response */ protected function show(PublicRequest $request, $slug) { $model = Coupon::findBySlug($slug); $data = new CouponResource($model); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle($data['title'] . trans('coupon::coupon.name')) ->view('coupon::public.coupon.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }