adrema/database/settings/2021_11_18_230152_create_ge...

33 lines
826 B
PHP
Raw Normal View History

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