'required|min:2', 'first_name' => 'required|min:2', 'email' => 'required|email:rfc,dns,spoof', 'shop' => 'present|nullable|string|exists:magasins,name', 'subject' => 'required|min:2', 'order_ref' => 'sometimes', 'message' => 'required|min:20|max:1900', 'file' => 'nullable|mimes:jpg,jpeg,png,pdf|max:5120', 'ok_cgv' => 'accepted', ]; } /** * Get the error messages for the defined validation rules. * * @return array */ public function messages() { return [ 'ok_cgv.accepted' => __('You must accept the terms and conditions and the privacy policy'), 'file.max' => __('La taille du fichier ne peut pas dĂ©passer :max kilo-octets.'), 'file.mimes' => __('Le fichier doit ĂȘtre de type : :values.'), 'shop.exists' => __('Le magasin :exists est introuvable.') ]; } }