mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-25 06:49:15 +01:00
Order/location of columns is now variable
This commit is contained in:
@@ -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 AddVisibleColumnsSetting extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (!SettingsHelper::get('visible_columns')) {
|
||||
Setting::create([
|
||||
'name' => 'visible_columns',
|
||||
'value' => 'id,created_at,download,upload,ping',
|
||||
'description' => 'Columns visible in the "All Tests" table.'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Setting::whereIn('name', [
|
||||
'visible_columns',
|
||||
])->delete();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user