From b46b55316547fab14ef922d23afe10e471e87ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 17 Jan 2022 17:49:00 +0300 Subject: [PATCH] Revers quantity rule.. --- app/Http/Requests/Document/Document.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Http/Requests/Document/Document.php b/app/Http/Requests/Document/Document.php index 4c02e7ea4..d67ba226a 100644 --- a/app/Http/Requests/Document/Document.php +++ b/app/Http/Requests/Document/Document.php @@ -75,7 +75,7 @@ class Document extends FormRequest $size = 7; } - $rules['items.' . $key . '.quantity'] = 'required|numeric|gt:0|digits_between:1,' . $size; + $rules['items.' . $key . '.quantity'] = 'required|max:' . $size; $this->items_quantity_size[$key] = $size; } } @@ -107,8 +107,7 @@ class Document extends FormRequest if ($this->items_quantity_size) { foreach ($this->items_quantity_size as $key => $quantity_size) { - $messages['items.' . $key . '.quantity.digits_between'] = trans('validation.digits_between', ['attribute' => Str::lower(trans('invoices.quantity')), 'min' => 1, 'max' => $quantity_size]); - $messages['items.' . $key . '.quantity.gt'] = trans('validation.gt.numeric', ['attribute' => Str::lower(trans('invoices.quantity')), 'value' => 0]); + $messages['items.' . $key . '.quantity.max'] = trans('validation.size', ['attribute' => Str::lower(trans('invoices.quantity')), 'size' => $quantity_size]); } }