Make dashboard configurable.
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('dashboards', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->integer('width');
|
||||
$table->integer('height');
|
||||
$table->integer('sort');
|
||||
$table->boolean('active');
|
||||
$table->json('settings')->nullable();
|
||||
});
|
||||
|
||||
DB::table('dashboards')->insert([
|
||||
'name' => 'dashboard_not_paid',
|
||||
'width' => 2,
|
||||
'height' => 1,
|
||||
'sort' => 0,
|
||||
'active' => true,
|
||||
]);
|
||||
DB::table('dashboards')->insert([
|
||||
'name' => 'dashboard_not_sent',
|
||||
'width' => 1,
|
||||
'height' => 2,
|
||||
'sort' => 1,
|
||||
'active' => true,
|
||||
]);
|
||||
DB::table('dashboards')->insert([
|
||||
'name' => 'dashboard_no_address',
|
||||
'width' => 1,
|
||||
'height' => 1,
|
||||
'sort' => 2,
|
||||
'active' => true,
|
||||
]);
|
||||
DB::table('dashboards')->insert([
|
||||
'name' => 'dashboard_incoming',
|
||||
'width' => 1,
|
||||
'height' => 1,
|
||||
'sort' => 3,
|
||||
'active' => true,
|
||||
]);
|
||||
DB::table('dashboards')->insert([
|
||||
'name' => 'dashboard_graph_year',
|
||||
'width' => 2,
|
||||
'height' => 1,
|
||||
'sort' => 4,
|
||||
'active' => true,
|
||||
]);
|
||||
DB::table('dashboards')->insert([
|
||||
'name' => 'dashboard_graph_month',
|
||||
'width' => 4,
|
||||
'height' => 1,
|
||||
'sort' => 5,
|
||||
'active' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('dashboards');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user