|
- <?php
-
- declare(strict_types=1);
-
- namespace App\ViewModels;
-
- class CampaignViewModel
- {
- public string $title = 'Campaigns';
- public bool $saved = false;
- public bool $deleted = false;
-
- /**
- * @var array{name: string, campaign_type_id: int|string, attribute_values: array<string, string>}
- */
- public array $form = [
- 'campaign_type_id' => 0,
- 'attribute_values' => [],
- ];
-
- /**
- * @var array<string, list<string>>
- */
- public array $errors = [];
-
- /**
- * @var array<string, mixed>|null
- */
- public ?array $campaign = null;
-
- /**
- * All campaign types with attributes decoded, used to populate the type
- * dropdown and drive the dynamic attribute fields.
- *
- * @var list<array{id: int, name: string, attributes: list<array{name: string, type: string}>}>
- */
- public array $campaignTypes = [];
- }
|