Explorar o código

add contact request name default value

olinox14 hai 1 ano
pai
achega
41efaa5efa
Modificáronse 1 ficheiros con 2 adicións e 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',