59 lines
2.1 KiB
PHP
59 lines
2.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class NewGuiSettings extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
$setting = new \App\Models\Setting();
|
|
$setting->name = "name_big";
|
|
$setting->description = "First Part of the Name, written big on the Webpage";
|
|
$setting->typ = "textinput";
|
|
$setting->value = \App\Models\Setting::getSettingValue("name");
|
|
$setting->saveOrFail();
|
|
$setting = new \App\Models\Setting();
|
|
$setting->name = "name_small";
|
|
$setting->description = "Secound Part of the Name, written smal on the Webpage";
|
|
$setting->typ = "textinput";
|
|
$setting->value = "";
|
|
$setting->saveOrFail();
|
|
\App\Models\Setting::query()->where("name", "=", "name")->delete();
|
|
$setting = new \App\Models\Setting();
|
|
$setting->name = "name_slogen";
|
|
$setting->description = "Slogen show on the Webpage";
|
|
$setting->typ = "textinput";
|
|
$setting->value = "Zentraler authentication Service";
|
|
$setting->saveOrFail();
|
|
$setting = new \App\Models\Setting();
|
|
$setting->name = "startpage";
|
|
$setting->description = "Show startpage, if not enabled the user will redirect to the login page";
|
|
$setting->typ = "checkbox";
|
|
$setting->value = true;
|
|
$setting->saveOrFail();
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
$setting = new \App\Models\Setting();
|
|
$setting->name = "name";
|
|
$setting->description = "Name of this Service";
|
|
$setting->value = \App\Models\Setting::getSettingValue("name_big").\App\Models\Setting::getSettingValue("name_small");
|
|
$setting->saveOrFail();
|
|
\App\Models\Setting::query()->where("name", "=", "name_big")->delete();
|
|
\App\Models\Setting::query()->where("name", "=", "name_small")->delete();
|
|
\App\Models\Setting::query()->where("name", "=", "name_slogen")->delete();
|
|
}
|
|
}
|