|null $types */ public function __construct( public readonly int $tenantId, public readonly ?array $types = null, ) {} public function handle(PolicySyncService $service): void { $tenant = Tenant::findOrFail($this->tenantId); $supported = config('tenantpilot.supported_policy_types'); if ($this->types !== null) { $supported = array_values(array_filter($supported, fn ($type) => in_array($type['type'], $this->types, true))); } $service->syncPolicies($tenant, $supported); } }