From 3bb619b29e47d7c41d5e03d7c27ecd4c9ae78f7c Mon Sep 17 00:00:00 2001 From: Venelin Iliev Date: Mon, 23 Jan 2017 11:15:48 +0200 Subject: [PATCH] settings migration and model --- app/Dashboard.php | 5 +-- app/Settings.php | 16 ++++++++ composer.json | 2 +- ...017_01_23_111236_create_settings_table.php | 40 +++++++++++++++++++ 4 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 app/Settings.php create mode 100644 database/migrations/2017_01_23_111236_create_settings_table.php diff --git a/app/Dashboard.php b/app/Dashboard.php index 2ff3c30..16ba930 100644 --- a/app/Dashboard.php +++ b/app/Dashboard.php @@ -7,10 +7,9 @@ namespace ProVision\Administration; -use Illuminate\Support\Facades\Facade; use ProVision\Administration\Dashboard\DashboardBox; -class Dashboard extends Facade +class Dashboard { private static $dashboards = []; @@ -25,7 +24,7 @@ public static function add(DashboardBox $object, $index = false) } if (isset(static::$dashboards[$index])) { - die('Box index duplicate: '.$index); + die('Box index duplicate: ' . $index); } static::$dashboards[$index] = $object; diff --git a/app/Settings.php b/app/Settings.php new file mode 100644 index 0000000..4c0979f --- /dev/null +++ b/app/Settings.php @@ -0,0 +1,16 @@ +increments('id'); + $table->string('module')->index(); + $table->string('sub_module')->nullable()->default(null)->index(); + $table->string('key')->index(); + $table->longText('value')->nullable()->default(null); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('settings'); + } +}