Added optional authentication

This commit is contained in:
Henry Whitaker
2020-08-21 17:31:43 +01:00
parent cd87a902a7
commit e10b4dccde
31 changed files with 149588 additions and 107 deletions

View File

@@ -0,0 +1,38 @@
<?php
use App\Helpers\SettingsHelper;
use App\Setting;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAuthenticationSettings extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if(!SettingsHelper::get('auth')) {
Setting::create([
'name' => 'auth',
'value' => false,
'description' => 'Enable authentication.'
]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Setting::whereIn('name', [
'auth',
])->delete();
}
}