adrema/app/Initialize/Initializer.php

35 lines
797 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;
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
}
}
}