feat: Refactor bootstrap functionality by adding AdminApp and Tenant controllers, requests, resources, and services; remove deprecated event form components

This commit is contained in:
2026-08-03 13:37:37 -03:00
parent f4638bc984
commit 12697c2268
26 changed files with 207 additions and 283 deletions

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Domains\Bootstrap\Requests;
use App\Domains\Tenant\Support\TenantDomainNormalizer;
use Closure;
use Illuminate\Foundation\Http\FormRequest;
class TenantBootstrapRequest extends FormRequest
{
protected bool $hasInvalidDomain = false;
public function authorize(): bool
{
return true;
}
protected function prepareForValidation(): void
{
$rawDomain = $this->route('dominio');
$normalizedDomain = TenantDomainNormalizer::normalize($rawDomain);
$this->hasInvalidDomain = TenantDomainNormalizer::hasValue($rawDomain)
&& $normalizedDomain === null;
$this->merge(['dominio' => $normalizedDomain]);
}
/** @return array<string, mixed> */
public function rules(): array
{
return [
'dominio' => [
'bail',
function (string $attribute, mixed $value, Closure $fail): void {
if ($this->hasInvalidDomain) {
$fail("The {$attribute} field must contain a valid domain or URL.");
}
},
'required',
'string',
'max:255',
],
];
}
}