-
-
Notifications
You must be signed in to change notification settings - Fork 676
Expand file tree
/
Copy pathPartialUpdateOrganizerSettingsRequest.php
More file actions
76 lines (66 loc) · 4.29 KB
/
Copy pathPartialUpdateOrganizerSettingsRequest.php
File metadata and controls
76 lines (66 loc) · 4.29 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
namespace HiEvents\Http\Request\Organizer\Settings;
use HiEvents\DomainObjects\Enums\AttendeeDetailsCollectionMethod;
use HiEvents\DomainObjects\Enums\HomepageBackgroundType;
use HiEvents\DomainObjects\Enums\OrganizerHomepageVisibility;
use HiEvents\Http\Request\BaseRequest;
use HiEvents\Validators\Rules\RulesHelper;
use Illuminate\Validation\Rule;
class PartialUpdateOrganizerSettingsRequest extends BaseRequest
{
public static function rules(): array
{
return [
// Event defaults
'default_attendee_details_collection_method' => ['sometimes', 'nullable', Rule::in(AttendeeDetailsCollectionMethod::valuesArray())],
'default_show_marketing_opt_in' => ['sometimes', 'nullable', 'boolean'],
// Social handles
'facebook_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'instagram_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'twitter_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'linkedin_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'discord_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'tiktok_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'youtube_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'snapchat_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'twitch_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'reddit_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'pinterest_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'whatsapp_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'telegram_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'vk_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'weibo_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'wechat_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'flickr_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'tumblr_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'quora_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'vimeo_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'github_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'website_url' => ['sometimes', 'nullable', 'url'],
// Location details
'location_details' => ['sometimes', 'array'],
'location_details.venue_name' => ['sometimes', 'nullable', 'string', 'max:255'],
'location_details.address_line_1' => ['sometimes', 'nullable', 'string', 'max:255'],
'location_details.address_line_2' => ['sometimes', 'nullable', 'string', 'max:255'],
'location_details.city' => ['sometimes', 'nullable', 'string', 'max:85'],
'location_details.state_or_region' => ['sometimes', 'nullable', 'string', 'max:85'],
'location_details.zip_or_postal_code' => ['sometimes', 'nullable', 'string', 'max:85'],
'location_details.country' => ['sometimes', 'nullable', 'string', 'max:2'],
// Homepage
'homepage_visibility' => ['nullable', Rule::in(OrganizerHomepageVisibility::valuesArray())],
// Homepage theme settings
'homepage_theme_settings' => ['nullable', 'array'],
'homepage_theme_settings.accent' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
'homepage_theme_settings.background' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
'homepage_theme_settings.mode' => ['nullable', 'string', Rule::in(['light', 'dark'])],
'homepage_theme_settings.background_type' => ['nullable', 'string', Rule::in(HomepageBackgroundType::valuesArray())],
// SEO
'seo_keywords' => ['sometimes', 'nullable', 'string', 'max:255'],
'seo_title' => ['sometimes', 'nullable', 'string', 'max:255'],
'seo_description' => ['sometimes', 'nullable', 'string', 'max:1000'],
'allow_search_engine_indexing' => ['sometimes', 'nullable', 'boolean'],
// Password
'homepage_password' => ['sometimes', 'nullable', 'string', 'max:100'],
];
}
}