2
2
3
3
namespace Coderflex \LaravelSendy \DTOs ;
4
4
5
+ use Spatie \LaravelData \Attributes \MergeValidationRules ;
5
6
use Spatie \LaravelData \Data ;
6
7
use Spatie \LaravelData \Support \Validation \ValidationContext ;
7
8
9
+ #[MergeValidationRules]
8
10
class SubscribersDTO extends Data
9
11
{
10
12
public function __construct (
@@ -19,18 +21,11 @@ public function __construct(
19
21
public ?bool $ boolean ,
20
22
) {}
21
23
22
- // public static function rules(ValidationContext $context): array
23
- // {
24
- // return [
25
- // 'name' => ['string', 'nullable'],
26
- // 'email' => ['required', 'string', 'email'],
27
- // 'list' => ['required', 'string'],
28
- // 'country' => ['string', 'nullable'],
29
- // 'ipaddress' => ['string', 'nullable', 'ip'],
30
- // 'referrer' => ['string', 'nullable'],
31
- // 'gdpr' => ['boolean', 'nullable'],
32
- // 'silent' => ['boolean', 'nullable'],
33
- // 'boolean' => ['boolean', 'nullable'],
34
- // ];
35
- // }
24
+ public static function rules (ValidationContext $ context ): array
25
+ {
26
+ return [
27
+ 'email ' => ['email ' ],
28
+ 'ipaddress ' => ['ip ' ],
29
+ ];
30
+ }
36
31
}
0 commit comments