-
-
Notifications
You must be signed in to change notification settings - Fork 675
Expand file tree
/
Copy pathCreateAccountRequest.php
More file actions
42 lines (37 loc) · 1.6 KB
/
Copy pathCreateAccountRequest.php
File metadata and controls
42 lines (37 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types=1);
namespace HiEvents\Http\Request\Account;
use HiEvents\Http\Request\BaseRequest;
use HiEvents\Locale;
use HiEvents\Validators\Rules\RulesHelper;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Password;
class CreateAccountRequest extends BaseRequest
{
public function rules(): array
{
$currencies = include __DIR__ . '/../../../../data/currencies.php';
return [
'first_name' => RulesHelper::REQUIRED_STRING,
'last_name' => RulesHelper::STRING,
'email' => RulesHelper::REQUIRED_EMAIL,
'password' => ['required', 'confirmed', Password::min(8)],
'timezone' => ['timezone:all'],
'currency_code' => [Rule::in(array_values($currencies))],
'locale' => ['nullable', Rule::in(Locale::getSupportedLocales())],
'invite_token' => ['nullable', 'string'],
'marketing_opt_in' => 'boolean|nullable',
// UTM attribution fields
'utm_source' => ['nullable', 'string', 'max:255'],
'utm_medium' => ['nullable', 'string', 'max:255'],
'utm_campaign' => ['nullable', 'string', 'max:255'],
'utm_term' => ['nullable', 'string', 'max:255'],
'utm_content' => ['nullable', 'string', 'max:255'],
'referrer_url' => ['nullable', 'string', 'max:2048'],
'landing_page' => ['nullable', 'string', 'max:2048'],
'gclid' => ['nullable', 'string', 'max:255'],
'fbclid' => ['nullable', 'string', 'max:255'],
'utm_raw' => ['nullable', 'array'],
];
}
}