fix: 🩹 add numeric validation for phone and postal_code in ListenFormRequest

This commit is contained in:
Nicolas Demangeat 2025-07-22 09:06:26 +02:00
parent d70dbce0f6
commit 19e2fc4f6a

View file

@ -46,8 +46,8 @@ class ListenFormRequest extends FormRequest
!is_null(request()->input('country')) ?
(Country::make(request()->input('country'))->value === Country::france->value ?
'phone:FR|max:25' :
'max:50') :
'max:50'
'numeric|max:50') :
'numeric|max:50'
],
'postal_code' => [
'present',
@ -55,8 +55,8 @@ class ListenFormRequest extends FormRequest
!is_null(request()->input('country')) ?
(Country::make(request()->input('country'))->value === Country::france->value ?
'postal_code:FR|max:25' :
'max:50') :
'max:50'
'numeric|max:50') :
'numeric|max:50'
],
'city' => 'present|nullable|string|between:3,20',
'country' => ['present', 'nullable', new Enum(Country::class)],