Added healthchecks.io int

This commit is contained in:
Henry Whitaker
2020-08-12 14:07:47 +01:00
parent 33169be746
commit f32fcf8256
11 changed files with 194 additions and 116 deletions

View File

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