Add cross-organisation admin API endpoints behind role:super_admin middleware: - AdminOrganisationController: CRUD with search, filter, billing_status management - AdminUserController: user management with role assignment across orgs - AdminStatsController: platform-wide aggregate statistics - AdminActivityLogController: filterable activity log viewer - AdminImpersonationController + ImpersonationService: user impersonation with token-based session management and activity logging - BillingStatus enum, form requests, API resources, 23 feature tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33 lines
859 B
PHP
33 lines
859 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use App\Enums\BillingStatus;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
use Illuminate\Validation\Rules\Enum;
|
|
|
|
final class AdminUpdateOrganisationRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/** @return array<string, mixed> */
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'name' => ['sometimes', 'string', 'max:255'],
|
|
'slug' => [
|
|
'sometimes', 'string', 'max:255', 'regex:/^[a-z0-9-]+$/',
|
|
Rule::unique('organisations', 'slug')->ignore($this->route('organisation')),
|
|
],
|
|
'billing_status' => ['sometimes', new Enum(BillingStatus::class)],
|
|
'settings' => ['nullable', 'array'],
|
|
];
|
|
}
|
|
}
|