check(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'code' => [ 'required', 'numeric', 'unique:code_eans,code', 'regex:/^[0-9]{7}$|^[0-9]{8}$|^[0-9]{13}$/', ], 'product' => 'required|string|min:3|max:255', ]; } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'code' => trans('Code EAN'), 'product' => trans('Produit'), ]; } }