Add hidden columns setting

This commit is contained in:
Henry Whitaker
2021-04-10 11:25:59 +01:00
parent 305e4bb17f
commit b232c21ae1
3 changed files with 40 additions and 0 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 AddHiddenColumnsSetting extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (!SettingsHelper::get('hidden_columns')) {
Setting::create([
'name' => 'hidden_columns',
'value' => 'server_id,server_name,server_host,url,scheduled',
'description' => 'Columns hidden from the "All Tests" table.'
]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Setting::whereIn('name', [
'hidden_columns',
])->delete();
}
}