check(); } /** * Prepare the data for validation. * * @return void */ public function prepareForValidation(): void { $this->merge([ 'coupon' => collect($this->post('coupon'))->filter() ->map(fn (string $value) => \is_numeric($value) ? intval($value) : $value) ->all() ]); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'coupon' => 'required|array|min:1', 'coupon.*' => 'required|integer' ]; } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'coupon' => trans('coupon'), 'coupon.*' => trans('coupon'), ]; } }