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_04_26_092613_recaptcha.php

55 lines
1.7 KiB
PHP
Raw Permalink Normal View History

2019-04-28 12:49:10 +00:00
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class Recaptcha extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$setting = new \App\Models\Setting();
$setting->name = "recaptcha_v2_register";
$setting->description = "Enabled Recaptcha for Register Page";
$setting->typ = "checkbox";
$setting->value = 0;
$setting->saveOrFail();
$setting = new \App\Models\Setting();
$setting->name = "recaptcha_v2_login";
$setting->description = "Enabled Recaptcha for Login to Account-Service";
$setting->typ = "checkbox";
$setting->value = 0;
$setting->saveOrFail();
$setting = new \App\Models\Setting();
$setting->name = "recaptcha_v2_key";
$setting->description = "Recaptcha V2 Key";
$setting->typ = "textinput";
$setting->value = "";
$setting->saveOrFail();
$setting = new \App\Models\Setting();
$setting->name = "recaptcha_v2_secret";
$setting->description = "Recaptcha V2 Secret";
$setting->typ = "textinput";
$setting->value = "";
$setting->saveOrFail();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
\App\Models\Setting::query()->where("name", "=", "recaptcha_v2_register")->delete();
\App\Models\Setting::query()->where("name", "=", "recaptcha_v2_login")->delete();
\App\Models\Setting::query()->where("name", "=", "recaptcha_v2_key")->delete();
\App\Models\Setting::query()->where("name", "=", "recaptcha_v2_secret")->delete();
}
}