'sometimes|nullable|image|mimes:jpeg,png,jpg,gif', 'after' => 'sometimes|nullable|image|mimes:jpeg,png,jpg,gif', // 'name' => 'required|nullable|string|max:255|regex:/^(?![ .]+$)(?!\.)(?!.*[. ])[a-zA-Z. ]+$/', 'grade' => 'sometimes|nullable|string', 'graft' => 'sometimes|nullable|string' ]; } public function messages() { return [ 'before.image' => 'The before image must be an image file.', 'before.mimes' => 'The before image must be a file of type: jpeg, png, jpg, gif.', 'after.image' => 'The after image must be an image file.', 'after.mimes' => 'The after image must be a file of type: jpeg, png, jpg, gif.', // 'name.required' => 'The name field is required.', // 'name.string' => 'The name field must be a string.', // 'name.max' => 'The name may not be greater than 255 characters.', // 'name.regex' => 'The name field only accepts letters, spaces, and dots.', 'grade.string' => 'The grade field must be a string.', 'graft.string' => 'The graft field must be a string.', ]; } /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { return true; } }