瀏覽代碼

add contact request name default value

olinox14 1 年之前
父節點
當前提交
41efaa5efa
共有 1 個文件被更改,包括 2 次插入1 次删除
  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',