adrema/app/Initialize/Initializer.php

36 lines
798 B
PHP
Raw Normal View History

2022-01-03 01:17:24 +01:00
<?php
namespace App\Initialize;
2022-02-19 18:06:07 +01:00
use App\Setting\NamiSettings;
2022-01-03 01:17:24 +01:00
2022-03-11 20:19:17 +01:00
class Initializer
{
2022-02-19 18:06:07 +01:00
public NamiSettings $settings;
2022-08-31 00:34:20 +02:00
2022-02-19 18:06:07 +01:00
public array $initializers = [
2022-03-15 10:24:04 +01:00
InitializeGroups::class,
2022-01-03 01:17:24 +01:00
InitializeNationalities::class,
InitializeFees::class,
InitializeConfessions::class,
InitializeCountries::class,
InitializeGenders::class,
InitializeRegions::class,
InitializeActivities::class,
InitializeCourses::class,
InitializeMembers::class,
];
2022-02-19 18:06:07 +01:00
public function __construct(NamiSettings $settings)
{
$this->settings = $settings;
}
2022-03-11 20:19:17 +01:00
public function run(): void
{
2022-02-19 18:06:07 +01:00
foreach ($this->initializers as $initializer) {
app($initializer)->handle($this->settings->login());
2022-01-03 01:17:24 +01:00
}
}
}