Implement multi-tenancy support with OAuth2 authentication for tenant admins, Stripe integration for event purchases and credits ledger, new Filament resources for event purchases, updated API routes and middleware for tenant isolation and token guarding, added factories/seeders/migrations for new models (Tenant, EventPurchase, OAuth entities, etc.), enhanced tests, and documentation updates. Removed outdated DemoAchievementsSeeder.
This commit is contained in:
66
app/Http/Requests/Tenant/SettingsStoreRequest.php
Normal file
66
app/Http/Requests/Tenant/SettingsStoreRequest.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Tenant;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SettingsStoreRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'settings' => ['required', 'array'],
|
||||
'settings.branding' => ['sometimes', 'array'],
|
||||
'settings.branding.logo_url' => ['nullable', 'url', 'max:500'],
|
||||
'settings.branding.primary_color' => ['nullable', 'regex:/^#[0-9A-Fa-f]{6}$/'],
|
||||
'settings.branding.secondary_color' => ['nullable', 'regex:/^#[0-9A-Fa-f]{6}$/'],
|
||||
'settings.branding.font_family' => ['nullable', 'string', 'max:100'],
|
||||
'settings.features' => ['sometimes', 'array'],
|
||||
'settings.features.photo_likes_enabled' => ['nullable', 'boolean'],
|
||||
'settings.features.event_checklist' => ['nullable', 'boolean'],
|
||||
'settings.features.custom_domain' => ['nullable', 'boolean'],
|
||||
'settings.features.advanced_analytics' => ['nullable', 'boolean'],
|
||||
'settings.custom_domain' => ['nullable', 'string', 'max:255', 'regex:/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/'],
|
||||
'settings.contact_email' => ['nullable', 'email', 'max:255'],
|
||||
'settings.event_default_type' => ['nullable', 'string', 'max:50'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom messages for validator errors.
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'settings.required' => 'Settings-Daten sind erforderlich.',
|
||||
'settings.branding.logo_url.url' => 'Die Logo-URL muss eine gültige URL sein.',
|
||||
'settings.branding.primary_color.regex' => 'Die Primärfarbe muss ein gültiges Hex-Format (#RRGGBB) haben.',
|
||||
'settings.branding.secondary_color.regex' => 'Die Sekundärfarbe muss ein gültiges Hex-Format (#RRGGBB) haben.',
|
||||
'settings.custom_domain.regex' => 'Das Custom Domain muss ein gültiges Domain-Format haben.',
|
||||
'settings.contact_email.email' => 'Die Kontakt-E-Mail muss eine gültige E-Mail-Adresse sein.',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the data for validation.
|
||||
*/
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
$this->merge([
|
||||
'settings' => $this->input('settings', []),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user