diff --git a/composer.json b/composer.json index c303802a8..3b1398d36 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "version": "2.0.0-rc.6", + "version": "2.0.0-rc.7", "name": "uasoft-indonesia/badaso", "description": "The First Open-Source Laravel Vue headless CMS (PWA dashboard + CRUD + API generator & more) for more productivity !", "keywords": [ diff --git a/src/Config/badaso.php b/src/Config/badaso.php index ae796e59e..779df4656 100644 --- a/src/Config/badaso.php +++ b/src/Config/badaso.php @@ -5,6 +5,7 @@ 'admin_panel_route_prefix' => env('MIX_ADMIN_PANEL_ROUTE_PREFIX', 'badaso-dashboard'), 'default_menu' => env('MIX_DEFAULT_MENU', 'admin'), 'api_route_prefix' => env('MIX_API_ROUTE_PREFIX', 'badaso-api'), + 'license_key' => env('BADASO_LICENSE_KEY'), 'storage' => [ 'disk' => env('FILESYSTEM_DRIVER', 'public'), ], diff --git a/src/Controllers/BadasoDashboardController.php b/src/Controllers/BadasoDashboardController.php index c8111354b..cdd8699fd 100644 --- a/src/Controllers/BadasoDashboardController.php +++ b/src/Controllers/BadasoDashboardController.php @@ -14,9 +14,9 @@ class BadasoDashboardController extends Controller { public function verifyLicense() { - $license = env('BADASO_LICENSE_KEY'); + $license = config('badaso.license_key'); if (is_null($license)) { - return ApiResponse::paymentRequired('BADASO_LICENSE_KEY not found'); + return ApiResponse::paymentRequired('BADASO_LICENSE_KEY not found on .env'); } elseif ($license == '') { return ApiResponse::paymentRequired('BADASO_LICENSE_KEY License Empty'); } else { diff --git a/src/Migrations/2020_11_13_064800_create_data_type.php b/src/Migrations/2020_11_13_064800_create_data_type.php index cb8741615..9594e52af 100644 --- a/src/Migrations/2020_11_13_064800_create_data_type.php +++ b/src/Migrations/2020_11_13_064800_create_data_type.php @@ -29,9 +29,10 @@ public function up() $table->enum('order_direction', ['ASC', 'DESC'])->nullable(); $table->boolean('generate_permissions')->default(false); $table->tinyInteger('server_side')->default(0); + $table->boolean('is_maintenance')->default(false); $table->text('description')->nullable(); - $table->text('details')->nullable(); + $table->text('notification')->nullable(); $table->boolean('is_soft_delete')->default(0)->nullable(); $table->timestamps(); }); diff --git a/src/Migrations/2020_11_18_014827_create_configurations.php b/src/Migrations/2020_11_18_014827_create_configurations.php index 0b1635cee..51b690da1 100644 --- a/src/Migrations/2020_11_18_014827_create_configurations.php +++ b/src/Migrations/2020_11_18_014827_create_configurations.php @@ -23,6 +23,7 @@ public function up() $table->string('type'); $table->integer('order')->default('1'); $table->string('group')->nullable(); + $table->boolean('can_delete')->default(false); $table->timestamps(); }); } catch (PDOException $ex) { diff --git a/src/Migrations/2020_11_18_014950_create_permissions.php b/src/Migrations/2020_11_18_014950_create_permissions.php index 7a421f5cf..098264556 100644 --- a/src/Migrations/2020_11_18_014950_create_permissions.php +++ b/src/Migrations/2020_11_18_014950_create_permissions.php @@ -20,6 +20,7 @@ public function up() $table->string('description')->nullable(); $table->string('table_name')->nullable(); $table->boolean('always_allow')->default(false); + $table->boolean('is_public')->default(false); $table->timestamps(); }); } catch (PDOException $ex) { diff --git a/src/Migrations/2020_11_18_015020_create_menus.php b/src/Migrations/2020_11_18_015020_create_menus.php index a943768f8..a59c527d2 100644 --- a/src/Migrations/2020_11_18_015020_create_menus.php +++ b/src/Migrations/2020_11_18_015020_create_menus.php @@ -18,6 +18,7 @@ public function up() $table->increments('id'); $table->string('key')->unique(); $table->string('display_name'); + $table->string('icon')->nullable(); $table->timestamps(); }); } catch (PDOException $ex) { diff --git a/src/Migrations/2020_11_18_015341_add_badaso_user_field.php b/src/Migrations/2020_11_18_015341_add_badaso_user_field.php index 83b4fa386..d9bcc6cb0 100644 --- a/src/Migrations/2020_11_18_015341_add_badaso_user_field.php +++ b/src/Migrations/2020_11_18_015341_add_badaso_user_field.php @@ -16,7 +16,7 @@ public function up() try { Schema::table('users', function (Blueprint $table) { if (! Schema::hasColumn('users', 'avatar')) { - $table->string('avatar')->nullable()->after('email')->default('users/default.png'); + $table->string('avatar')->nullable()->after('email')->default('files/shares/default-user.png'); } if (! Schema::hasColumn('users', 'additional_info')) { $table->text('additional_info')->nullable()->after('email'); diff --git a/src/Migrations/2021_02_19_033756_add_icon_to_menus.php b/src/Migrations/2021_02_19_033756_add_icon_to_menus.php deleted file mode 100644 index 174ca4f86..000000000 --- a/src/Migrations/2021_02_19_033756_add_icon_to_menus.php +++ /dev/null @@ -1,36 +0,0 @@ -string('icon')->nullable()->after('display_name'); - } - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('menus', function (Blueprint $table) { - if (Schema::hasColumn('menus', 'icon')) { - $table->dropColumn('icon'); - } - }); - } -} diff --git a/src/Migrations/2021_03_02_022959_add_column_to_permissions.php b/src/Migrations/2021_03_02_022959_add_column_to_permissions.php deleted file mode 100644 index 82af9f416..000000000 --- a/src/Migrations/2021_03_02_022959_add_column_to_permissions.php +++ /dev/null @@ -1,36 +0,0 @@ -boolean('is_public')->default(false)->after('always_allow'); - } - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('permissions', function (Blueprint $table) { - if (Schema::hasColumn('permissions', 'is_public')) { - $table->dropColumn('is_public'); - } - }); - } -} diff --git a/src/Migrations/2021_03_16_064043_add_can_delete_to_configurations.php b/src/Migrations/2021_03_16_064043_add_can_delete_to_configurations.php deleted file mode 100644 index 24b11b803..000000000 --- a/src/Migrations/2021_03_16_064043_add_can_delete_to_configurations.php +++ /dev/null @@ -1,36 +0,0 @@ -boolean('can_delete')->default(false)->after('group'); - } - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('configurations', function (Blueprint $table) { - if (Schema::hasColumn('configurations', 'can_delete')) { - $table->dropColumn('can_delete'); - } - }); - } -} diff --git a/src/Migrations/2021_04_23_024729_add_notification_on_event_in_data_types_table.php b/src/Migrations/2021_04_23_024729_add_notification_on_event_in_data_types_table.php deleted file mode 100644 index d5f63e9b7..000000000 --- a/src/Migrations/2021_04_23_024729_add_notification_on_event_in_data_types_table.php +++ /dev/null @@ -1,36 +0,0 @@ -text('notification')->nullable()->after('details'); - } - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('data_types', function (Blueprint $table) { - if (Schema::hasColumn('data_types', 'notification')) { - $table->dropColumn('notification'); - } - }); - } -} diff --git a/src/Migrations/2021_05_07_024347_add_is_maintenance_to_data_types_table.php b/src/Migrations/2021_05_07_024347_add_is_maintenance_to_data_types_table.php deleted file mode 100644 index 3fb578cf0..000000000 --- a/src/Migrations/2021_05_07_024347_add_is_maintenance_to_data_types_table.php +++ /dev/null @@ -1,36 +0,0 @@ -boolean('is_maintenance')->default(false)->after('server_side'); - } - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('data_types', function (Blueprint $table) { - if (Schema::hasColumn('data_types', 'is_maintenance')) { - $table->dropColumn('is_maintenance'); - } - }); - } -} diff --git a/src/Migrations/2021_06_14_091143_alter_avatar_field_on_user_table.php b/src/Migrations/2021_06_14_091143_alter_avatar_field_on_user_table.php deleted file mode 100644 index 82230f156..000000000 --- a/src/Migrations/2021_06_14_091143_alter_avatar_field_on_user_table.php +++ /dev/null @@ -1,42 +0,0 @@ -string('avatar')->nullable()->after('additional_info')->default('/files/shares/default-user.png')->change(); - } - }); - } catch (PDOException $ex) { - $this->down(); - - throw $ex; - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('users', function (Blueprint $table) { - if (Schema::hasColumn('users', 'avatar')) { - $table->string('avatar')->nullable()->after('additional_info')->default('users/default.png')->change(); - } - }); - } -} diff --git a/src/Migrations/2021_06_22_091143_alter_avatar_field_on_user_table_again.php b/src/Migrations/2021_06_22_091143_alter_avatar_field_on_user_table_again.php deleted file mode 100644 index 057b79cda..000000000 --- a/src/Migrations/2021_06_22_091143_alter_avatar_field_on_user_table_again.php +++ /dev/null @@ -1,42 +0,0 @@ -string('avatar')->nullable()->after('additional_info')->default('files/shares/default-user.png')->change(); - } - }); - } catch (PDOException $ex) { - $this->down(); - - throw $ex; - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('users', function (Blueprint $table) { - if (Schema::hasColumn('users', 'avatar')) { - $table->string('avatar')->nullable()->after('additional_info')->default('/files/shares/default-user.png')->change(); - } - }); - } -} diff --git a/src/Seeder/Configurations/SiteManagementSeeder.php b/src/Seeder/Configurations/SiteManagementSeeder.php index 9a8ed211d..cdb2edfe3 100644 --- a/src/Seeder/Configurations/SiteManagementSeeder.php +++ b/src/Seeder/Configurations/SiteManagementSeeder.php @@ -153,16 +153,11 @@ public function run() ], ]; - $new_settings = []; foreach ($settings as $key => $value) { - $setting = \DB::table('configurations')->where('key', $value['key'])->first(); - if (isset($setting)) { - continue; - } - $new_settings[] = $value; + \DB::table('configurations')->where('key', $value['key'])->delete(); } - \DB::table('configurations')->insert($new_settings); + \DB::table('configurations')->insert($settings); \DB::commit(); } catch (Exception $e) {