[ RemoveNonNumeric::class, FilterVars::class => [ 'filter' => \FILTER_SANITIZE_NUMBER_INT, ] ], 'eancode' => [ RemoveNonNumeric::class, FilterVars::class => [ 'filter' => \FILTER_SANITIZE_NUMBER_INT, ] ], ]; /** * Determine if the user is authorized to make this request. * * @return boolean */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'codelot' => 'required|numeric|digits:10', 'eancode' => ['required', 'numeric', 'regex:/^(\d{13})$/'] ]; } /** * Get custom messages for validator errors. * * @return array */ public function messages() { return [ 'eancode.regex' => trans('Doit être un code à 13 chiffres comme par exemple : 0 350217 648298') ]; } }