Explorar el Código

add contact request name default value

olinox14 hace 1 año
padre
commit
41efaa5efa
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/ApiResource/ContactRequest.php

+ 2 - 1
src/ApiResource/ContactRequest.php

@@ -23,7 +23,8 @@ class ContactRequest
     )]
     protected string $email;
 
-    protected ?string $name;
+    protected string $name = '';
+    
     #[Assert\Length(
         min: 10,
         minMessage: 'Message must be at least {{ limit }} characters long',