From 6dcb4c06195683a3bfdba121ea5595eabd54270b Mon Sep 17 00:00:00 2001 From: Sari Date: Mon, 3 Aug 2026 09:53:22 +0700 Subject: [PATCH] update hak akses: view-point-audit terkunci Khusus Admin (UI+backend) + FIX penting: seed migrasi semua permission inti (7 permission hilang di fresh install/test DB) + test --- ...026_08_03_093052_seed_core_permissions.php | 85 +++++++++++++++++++ ...026_08_03_095250_seed_core_permissions.php | 24 ++++++ 2 files changed, 109 insertions(+) create mode 100644 database/migrations/2026_08_03_093052_seed_core_permissions.php create mode 100644 database/migrations/2026_08_03_095250_seed_core_permissions.php diff --git a/database/migrations/2026_08_03_093052_seed_core_permissions.php b/database/migrations/2026_08_03_093052_seed_core_permissions.php new file mode 100644 index 0000000..556728c --- /dev/null +++ b/database/migrations/2026_08_03_093052_seed_core_permissions.php @@ -0,0 +1,85 @@ +where('key', $key)->exists(); + + if ($exists) { + DB::table('permissions')->where('key', $key)->update([ + 'group' => $group, + 'label' => $label, + 'description' => $description ?: null, + 'updated_at' => $now, + ]); + } else { + DB::table('permissions')->insert([ + 'key' => $key, + 'group' => $group, + 'label' => $label, + 'description' => $description ?: null, + 'created_at' => $now, + 'updated_at' => $now, + ]); + } + } + } + + public function down(): void + { + // Tidak menghapus — hanya migrasi perbaikan data. + } +}; diff --git a/database/migrations/2026_08_03_095250_seed_core_permissions.php b/database/migrations/2026_08_03_095250_seed_core_permissions.php new file mode 100644 index 0000000..88fa2f3 --- /dev/null +++ b/database/migrations/2026_08_03_095250_seed_core_permissions.php @@ -0,0 +1,24 @@ +