'required', 'email' => 'required|email', 'password' => [ 'required', 'confirmed', 'min:8', 'regex:/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/' ], ]; } /** * Get custom messages for validator errors. * * @return array */ public function messages() { return [ 'password.regex' => __('The password must be at least 8 characters long and contain at least one number and one special character (@$!%*?&).') ]; } /** * Get the password reset fields. * * @return array */ public function credentials() { return $this->only('email', 'password', 'password_confirmation', 'token'); } }