This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccount/database/migrations/2019_05_22_121930_new_gui_settings.php

60 lines
2.1 KiB
PHP
Raw Normal View History

<?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();
2019-06-06 13:44:45 +00:00
$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();
}
}