user()->can('create', Workspace::class); } public function rules(): array { $hex = ['nullable', 'string', 'regex:/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/']; return [ 'name' => ['required', 'string', 'max:255'], 'brand_website' => ['nullable', 'url', 'max:255'], 'brand_description' => ['nullable', 'string', 'max:2000'], 'brand_voice_traits' => ['nullable', 'array'], 'brand_voice_traits.*' => ['string', Rule::enum(BrandVoiceTrait::class)], 'brand_color' => $hex, 'background_color' => $hex, 'text_color' => $hex, 'brand_font' => ['sometimes', 'string', Rule::in(BrandFont::values())], 'image_style' => ['sometimes', 'string', Rule::in(ImageStyle::values())], 'content_language' => ['nullable', 'string', Rule::in(ContentLanguage::values())], 'logo_url' => ['nullable', 'url', 'max:1024'], ]; } }