negative quantity not allowed #1xphe64
This commit is contained in:
parent
6fa079d8b4
commit
2810423a20
@ -75,7 +75,7 @@ class Document extends FormRequest
|
||||
$size = 7;
|
||||
}
|
||||
|
||||
$rules['items.' . $key . '.quantity'] = 'required|max:' . $size;
|
||||
$rules['items.' . $key . '.quantity'] = 'required|max:' . $size . '|numeric|gt:0';
|
||||
$this->items_quantity_size[$key] = $size;
|
||||
}
|
||||
}
|
||||
@ -108,6 +108,7 @@ class Document extends FormRequest
|
||||
if ($this->items_quantity_size) {
|
||||
foreach ($this->items_quantity_size as $key => $quantity_size) {
|
||||
$messages['items.' . $key . '.quantity.max'] = trans('validation.size', ['attribute' => Str::lower(trans('invoices.quantity')), 'size' => $quantity_size]);
|
||||
$messages['items.' . $key . '.quantity.gt'] = trans('validation.gt.numeric', ['attribute' => Str::lower(trans('invoices.quantity')), 'value' => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user