|
- <?php
-
- declare(strict_types=1);
-
- namespace App\ViewModels;
-
- class EmployeeFormViewModel
- {
- public string $title = 'Employee Directory';
- public string $eyebrow = 'SQLite employee form';
- public string $intro = 'Capture employee details in a lightweight SQLite-backed page that fits the framework style.';
- public bool $saved = false;
- public string $search = '';
-
- /**
- * @var array<string, string>
- */
- public array $form = [
- 'first_name' => '',
- 'last_name' => '',
- 'email' => '',
- 'department' => '',
- 'job_title' => '',
- 'start_date' => '',
- ];
-
- /**
- * @var array<string, list<string>>
- */
- public array $errors = [];
-
- /**
- * @var list<array<string, mixed>>
- */
- public array $employees = [];
-
- /**
- * @var array<string, int|string>
- */
- public array $summary = [
- 'employee_count' => 0,
- 'department_count' => 0,
- 'latest_start_date' => 'N/A',
- ];
-
- /**
- * @var array<string, mixed>|null
- */
- public ?array $newestEmployee = null;
- }
|