Moved speedtest logic into interface

This commit is contained in:
Henry Whitaker
2021-03-07 10:26:09 +00:00
parent ba8f82aa98
commit a2d8886bae
10 changed files with 315 additions and 201 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 AddSpeedtestProviderSetting extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (!SettingsHelper::get('healthchecks_server_url')) {
Setting::create([
'name' => 'speedtest_provider',
'value' => 'ookla',
'description' => 'The provider/package used to run speedtests.'
]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Setting::whereIn('name', [
'speedtest_provider',
])->delete();
}
}