-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #406 from OpenSID/pengaturan-menu-presisi
pengaturan menu presisi
- Loading branch information
Showing
13 changed files
with
339 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
database/migrations/2024_10_26_040605_add_menu_type_table_menus.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('menus', function ($table) { | ||
// $table->integer('menu_type')->default(1)->change(); | ||
$table->string('menu_type')->default(1)->after('id'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('menus', function($table) { | ||
$table->dropColumn('menu_type'); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('menus', function ($table) { | ||
$table->string('icon')->nullable()->after('name'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('menus', function($table) { | ||
$table->dropColumn('icon'); | ||
}); | ||
} | ||
}; |
44 changes: 44 additions & 0 deletions
44
database/migrations/2024_10_28_082101_add-default-menu-presisi-datas.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
// Insert data baru tanpa tag <i> di kolom name | ||
DB::table("menus")->insert([ | ||
["id" => "192", "menu_type" => "2", "name" => "Demografi", "icon" => "fa-solid fa-chart-column", "url" => "/presisi", "sequence" => "2", "position" => "top", "parent_id" => NULL, "created_at" => "2023-09-27 17:39:33"], | ||
["id" => "193", "menu_type" => "2", "name" => "Sosial", "icon" => "fas fa-table", "url" => "/presisi/bantuan", "sequence" => "3", "position" => "top", "parent_id" => NULL, "created_at" => "2023-09-27 17:39:33"], | ||
["id" => "194", "menu_type" => "2", "name" => "Data Kemiskinan", "icon" => NULL, "url" => "/presisi/sosial", "sequence" => "1", "position" => "top", "parent_id" => "193", "created_at" => "2023-09-27 17:39:33"], | ||
["id" => "195", "menu_type" => "2", "name" => "Program Bantuan", "icon" => NULL, "url" => "/presisi/bantuan", "sequence" => "2", "position" => "top", "parent_id" => "193", "created_at" => "2023-09-27 17:39:33"], | ||
["id" => "196", "menu_type" => "2", "name" => "Kependudukan", "icon" => "fas fa-book", "url" => "/presisi/kependudukan", "sequence" => "4", "position" => "top", "parent_id" => NULL, "created_at" => "2023-09-27 17:39:33"], | ||
["id" => "197", "menu_type" => "2", "name" => "Statistik Penduduk", "icon" => NULL, "url" => "/presisi/kependudukan", "sequence" => "1", "position" => "top", "parent_id" => "196", "created_at" => "2023-09-27 17:39:33"], | ||
["id" => "198", "menu_type" => "2", "name" => "Statistik Keluarga", "icon" => NULL, "url" => "#", "sequence" => "2", "position" => "top", "parent_id" => "196", "created_at" => "2023-09-27 17:39:33"], | ||
["id" => "199", "menu_type" => "2", "name" => "Statistik RTM", "icon" => NULL, "url" => "#", "sequence" => "3", "position" => "top", "parent_id" => "196", "created_at" => "2023-09-27 17:39:33"], | ||
["id" => "200", "menu_type" => "2", "name" => "Ekonomi", "icon" => "fa fa-solid fa-briefcase", "url" => "/presisi/ekonomi", "sequence" => "5", "position" => "top", "parent_id" => NULL, "created_at" => "2023-09-27 17:39:33"], | ||
["id" => "201", "menu_type" => "2", "name" => "E-Stunting", "icon" => "fa fa-solid fa-camera-retro pl-1", "url" => "/presisi/kesehatan", "sequence" => "6", "position" => "top", "parent_id" => NULL, "created_at" => "2023-09-27 17:39:33"], | ||
["id" => "202", "menu_type" => "2", "name" => "Geo Spasial", "icon" => "fas fa-map", "url" => "#", "sequence" => "7", "position" => "top", "parent_id" => NULL, "created_at" => "2023-09-27 17:39:33"], | ||
]); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
|
||
// Menghapus data berdasarkan ID untuk rollback | ||
DB::table("menus")->whereIn('id', [192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202])->delete(); | ||
} | ||
}; |
Oops, something went wrong.