Added registration type of message

This commit is contained in:
2023-03-13 13:13:40 +10:00
parent 7605a826d6
commit 7ecec70520
3 changed files with 19 additions and 3 deletions

View File

@@ -27,11 +27,12 @@ class EventStoreRequest extends BaseRequest
Rule::in(['draft', 'soon', 'open', 'closed', 'cancelled']),
],
'registration_type' => [
Rule::in(['none', 'email', 'link']),
Rule::in(['none', 'email', 'link', 'message']),
],
'registration_data' => [
Rule::when(strcasecmp('email', $this->attributes->get('registration_type')) == 0, 'required|email'),
Rule::when(strcasecmp('link', $this->attributes->get('registration_type')) == 0, 'required|url')
Rule::when(strcasecmp('link', $this->attributes->get('registration_type')) == 0, 'required|url'),
Rule::when(strcasecmp('message', $this->attributes->get('registration_type')) == 0, 'required|message'),
],
'hero' => 'uuid|exists:media,id',
];