2021-11-19 00:15:20 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Spatie\LaravelSettings\Migrations\SettingsMigration;
|
|
|
|
|
|
|
|
class CreateGeneralSettings extends SettingsMigration
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $mode
|
2022-02-12 00:41:52 +01:00
|
|
|
* @return array<string, array<int,string>|bool>
|
2021-11-19 00:15:20 +01:00
|
|
|
*/
|
|
|
|
public function defaults(string $mode): array
|
|
|
|
{
|
|
|
|
$defaults = [
|
|
|
|
'diözese' => [
|
2021-11-19 22:58:27 +01:00
|
|
|
'modules' => ['courses'],
|
2021-11-19 00:39:34 +01:00
|
|
|
'single_view' => false,
|
2021-11-19 00:15:20 +01:00
|
|
|
],
|
|
|
|
'stamm' => [
|
2021-11-19 22:58:27 +01:00
|
|
|
'modules' => ['bill', 'courses'],
|
2021-11-19 00:39:34 +01:00
|
|
|
'single_view' => true,
|
2021-11-19 00:15:20 +01:00
|
|
|
]
|
|
|
|
];
|
|
|
|
|
|
|
|
return $defaults[$mode];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function up(): void
|
|
|
|
{
|
|
|
|
$defaults = $this->defaults(config('app.mode'));
|
2021-11-19 00:39:34 +01:00
|
|
|
$this->migrator->add('general.modules', $defaults['modules']);
|
|
|
|
$this->migrator->add('general.single_view', $defaults['single_view']);
|
2021-11-19 00:15:20 +01:00
|
|
|
}
|
|
|
|
}
|