From a1f4bd7f81b56e2ab22821e74e91e937a8b1ec39 Mon Sep 17 00:00:00 2001 From: arifal Date: Wed, 12 Mar 2025 15:37:22 +0700 Subject: [PATCH] fix seeder menu role and user assign, create 503 page and fix redirect home --- database/seeders/DatabaseSeeder.php | 26 +- database/seeders/MenuSeeder.php | 287 +++++++++++++++ database/seeders/RoleSeeder.php | 37 ++ database/seeders/UsersRoleMenuSeeder.php | 428 +++-------------------- resources/views/errors/503.blade.php | 41 +++ resources/views/home/index.blade.php | 20 +- resources/views/pages/404-alt.blade.php | 2 +- resources/views/pages/404.blade.php | 2 +- routes/web.php | 2 +- 9 files changed, 442 insertions(+), 403 deletions(-) create mode 100644 database/seeders/MenuSeeder.php create mode 100644 database/seeders/RoleSeeder.php create mode 100644 resources/views/errors/503.blade.php diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index cb6f7dc..816feaa 100755 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -15,17 +15,23 @@ class DatabaseSeeder extends Seeder */ public function run(): void { - // User::factory(10)->create(); + User::updateOrCreate( + ['email' => 'user@demo.com'], // Kondisi pencarian + [ + 'name' => 'Darkone', + 'email_verified_at' => now(), + 'password' => Hash::make('password'), + 'firstname' => 'John', + 'lastname' => 'Doe', + 'position' => 'crusial', + 'remember_token' => Str::random(10), + ] + ); - User::factory()->create([ - 'name' => 'Darkone', - 'email' => 'user@demo.com', - 'email_verified_at' => now(), - 'password' => Hash::make('password'), - 'firstname' => 'John', - 'lastname' => 'Doe', - 'position' => 'crusial', - 'remember_token' => Str::random(10), + $this->call([ + RoleSeeder::class, + MenuSeeder::class, + UsersRoleMenuSeeder::class ]); } } diff --git a/database/seeders/MenuSeeder.php b/database/seeders/MenuSeeder.php new file mode 100644 index 0000000..91efad5 --- /dev/null +++ b/database/seeders/MenuSeeder.php @@ -0,0 +1,287 @@ + "Dashboard", + "url" => "/dashboard", + "icon" => "mingcute:home-3-line", + "parent_id" => null, + "sort_order" => 1, + "children" => [ + [ + "name" => "Dashboard Pimpinan", + "url" => "dashboard.home", + "icon" => null, + "sort_order" => 1, + ], + [ + "name" => "Dashboard PBG", + "url" => "dashboard.pbg", + "icon" => null, + "sort_order" => 2, + ], + [ + "name" => "Dashboard Potensi", + "url" => '/potentials', + "icon" => null, + "sort_order" => 3, + "children" => [ + [ + "name" => "Luar Sistem", + "url" => "dashboard.potentials.inside_system", + "icon" => null, + "sort_order" => 1, + ], + [ + "name" => "Dalam Sistem", + "url" => "dashboard.potentials.outside_system", + "icon" => null, + "sort_order" => 2, + ], + ] + ], + [ + "name" => "PETA", + "url" => "dashboard.maps", + "icon" => null, + "sort_order" => 4, + ], + ], + ], + [ + "name" => "Master", + "url" => "/master", + "icon" => "mingcute:cylinder-line", + "parent_id" => null, + "sort_order" => 2, + "children" => [ + [ + "name" => "Users", + "url" => "users.index", + "icon" => null, + "sort_order" => 1, + ], + ] + ], + [ + "name" => "Settings", + "url" => "/settings", + "icon" => "mingcute:settings-6-line", + "parent_id" => null, + "sort_order" => 3, + "children" => [ + [ + "name" => "Syncronize", + "url" => "settings.syncronize", + "icon" => null, + "sort_order" => 1, + ], + [ + "name" => "Menu", + "url" => "menus.index", + "icon" => null, + "sort_order" => 2, + ], + [ + "name" => "Role", + "url" => "roles.index", + "icon" => null, + "sort_order" => 3, + ], + ] + ], + [ + "name" => "Data Settings", + "url" => "/data-settings", + "icon" => "mingcute:settings-1-line", + "parent_id" => null, + "sort_order" => 4, + "children" => [ + [ + "name" => "Setting Dashboard", + "url" => "data-settings.index", + "icon" => null, + "sort_order" => 1, + ], + ] + ], + [ + "name" => "Data", + "url" => "/data", + "icon" => "mingcute:task-line", + "parent_id" => null, + "sort_order" => 5, + "children" => [ + [ + "name" => "PBG", + "url" => "pbg-task.index", + "icon" => null, + "sort_order" => 1, + ], + [ + "name" => "Reklame", + "url" => "web.advertisements.index", + "icon" => null, + "sort_order" => 2, + ], + [ + "name" => "Usaha atau Industri", + "url" => "business-industries.index", + "icon" => null, + "sort_order" => 3, + ], + [ + "name" => "UMKM", + "url" => "web-umkm.index", + "icon" => null, + "sort_order" => 4, + ], + [ + "name" => "Pariwisata", + "url" => "web-tourisms.index", + "icon" => null, + "sort_order" => 5, + ], + [ + "name" => "Tata Ruang", + "url" => "web-spatial-plannings.index", + "icon" => null, + "sort_order" => 6, + ], + [ + "name" => "PDAM", + "url" => "customers", + "icon" => null, + "sort_order" => 7, + ], + [ + "name" => "Google Sheets", + "url" => "google-sheets", + "icon" => null, + "sort_order" => 8, + ], + [ + "name" => "TPA TPT", + "url" => "tpa-tpt.index", + "icon" => null, + "sort_order" => 9, + ], + ] + ], + [ + "name" => "Laporan", + "url" => "/laporan", + "icon" => "mingcute:report-line", + "parent_id" => null, + "sort_order" => 6, + "children" => [ + [ + "name" => "Lap Pariwisata", + "url" => "tourisms-report.index", + "icon" => null, + "sort_order" => 1, + ], + [ + "name" => "Lap Pimpinan", + "url" => "bigdata-resumes", + "icon" => null, + "sort_order" => 2, + ], + [ + "name" => "Rekap Pembayaran", + "url" => "payment-recaps", + "icon" => null, + "sort_order" => 3, + ], + [ + "name" => "Lap Rekap Data Pembayaran", + "url" => "report-payment-recaps", + "icon" => null, + "sort_order" => 4, + ], + [ + "name" => "Lap PBG (PTSP)", + "url" => "report-pbg-ptsp", + "icon" => null, + "sort_order" => 5, + ], + ] + ], + [ + "name" => "Neng Bedas", + "url" => "/chat", + "icon" => "mingcute:wechat-line", + "parent_id" => null, + "sort_order" => 7, + "children" => [ + [ + "name" => "Chat", + "url" => "main-chatbot.index", + "icon" => null, + "sort_order" => 1, + ], + ] + ], + [ + "name" => "Approval", + "url" => "/approval", + "icon" => "mingcute:user-follow-2-line", + "parent_id" => null, + "sort_order" => 8, + "children" => [ + [ + "name" => "Approval Pejabat", + "url" => "approval-list", + "icon" => null, + "sort_order" => 1, + ], + ] + ], + [ + "name" => "Tools", + "url" => "/tools", + "icon" => "mingcute:tool-line", + "parent_id" => null, + "sort_order" => 9, + "children" => [ + [ + "name" => "Undangan", + "url" => "invitations", + "icon" => null, + "sort_order" => 1, + ], + ] + ], + ]; + + foreach ($menus as $menuData) { + $this->createOrUpdateMenu($menuData); + } + } + + private function createOrUpdateMenu($menuData, $parentId = null){ + $menuData['parent_id'] = $parentId; + + $menu = Menu::updateOrCreate(['name' => $menuData['name']], Arr::except($menuData, ['children'])); + + if(!empty($menuData['children'])){ + foreach($menuData['children'] as $child){ + $this->createOrUpdateMenu($child, $menu->id); + } + } + } +} diff --git a/database/seeders/RoleSeeder.php b/database/seeders/RoleSeeder.php new file mode 100644 index 0000000..1e282ac --- /dev/null +++ b/database/seeders/RoleSeeder.php @@ -0,0 +1,37 @@ + "superadmin", + "description" => "show all menus for super admins", + ], + [ + "name" => "admin", + "description" => "show only necessary menus for admins", + ], + [ + "name" => "operator", + "description" => "show only necessary menus for operators", + ], + [ + "name" => "user", + "description" => "show only necessary menus for users", + ] + ]; + + Role::upsert($roles, ['name']); + } +} diff --git a/database/seeders/UsersRoleMenuSeeder.php b/database/seeders/UsersRoleMenuSeeder.php index b75647e..5a3fa5f 100644 --- a/database/seeders/UsersRoleMenuSeeder.php +++ b/database/seeders/UsersRoleMenuSeeder.php @@ -13,400 +13,54 @@ class UsersRoleMenuSeeder extends Seeder /** * Run the database seeds. */ - public function run(): void + public function run(): void { - $roles = [ - [ - "name" => "superadmin", - "description" => "show all menus for super admins", + // Fetch roles in a single query + $roles = Role::whereIn('name', ['superadmin', 'admin', 'operator'])->get()->keyBy('name'); + + // Fetch all menus in a single query and index by name + $menus = Menu::whereIn('name', [ + 'Dashboard', 'Master', 'Settings', 'Data Settings', 'Data', 'Laporan', 'Neng Bedas', + 'Approval', 'Tools', 'Dashboard Pimpinan', 'Dashboard PBG', 'Users', 'Syncronize', + 'Menu', 'Role', 'Setting Dashboard', 'PBG', 'Reklame', 'Usaha atau Industri', 'Pariwisata', + 'Lap Pariwisata', 'UMKM', 'Dashboard Potensi', 'Tata Ruang', 'PDAM', 'PETA', + 'Lap Pimpinan', 'Chat', 'Dalam Sistem', 'Luar Sistem', 'Google Sheets', 'TPA TPT', + 'Approval Pejabat', 'Undangan', 'Rekap Pembayaran', 'Lap Rekap Data Pembayaran', 'Lap PBG (PTSP)' + ])->get()->keyBy('name'); + + // Define access levels for each role + $permissions = [ + 'superadmin' => [ + 'Dashboard', 'Master', 'Settings', 'Data Settings', 'Data', 'Laporan', 'Neng Bedas', + 'Approval', 'Tools', 'Dashboard Pimpinan', 'Dashboard PBG', 'Users', 'Syncronize', + 'Menu', 'Role', 'Setting Dashboard', 'PBG', 'Reklame', 'Usaha atau Industri', 'Pariwisata', + 'Lap Pariwisata', 'UMKM', 'Dashboard Potensi', 'Tata Ruang', 'PDAM', 'Dalam Sistem', + 'Luar Sistem', 'Lap Pimpinan', 'Chat', 'Google Sheets', 'TPA TPT', 'Approval Pejabat', + 'Undangan', 'Rekap Pembayaran', 'Lap Rekap Data Pembayaran', 'Lap PBG (PTSP)' ], - [ - "name" => "admin", - "description" => "show only necessary menus for admins", - ], - [ - "name" => "operator", - "description" => "show only necessary menus for operators", - ] + 'admin' => ['Dashboard', 'Master', 'Settings'], + 'operator' => ['Dashboard', 'Data', 'Laporan'] ]; - Role::upsert($roles, ['name']); + // Define permission levels + $superadminPermissions = ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true]; + $adminPermissions = ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true]; + $operatorPermissions = ["allow_show" => true, "allow_create" => false, "allow_update" => false, "allow_destroy" => false]; - $parent_menus = [ - [ - "name" => "Dashboard", - "url" => "/dashboard", - "icon" => "mingcute:home-3-line", - "parent_id" => null, - "sort_order" => 1, - ], - [ - "name" => "Master", - "url" => "/master", - "icon" => "mingcute:cylinder-line", - "parent_id" => null, - "sort_order" => 2, - ], - [ - "name" => "Settings", - "url" => "/settings", - "icon" => "mingcute:settings-6-line", - "parent_id" => null, - "sort_order" => 3, - ], - [ - "name" => "Data Settings", - "url" => "/data-settings", - "icon" => "mingcute:settings-1-line", - "parent_id" => null, - "sort_order" => 4, - ], - [ - "name" => "Data", - "url" => "/data", - "icon" => "mingcute:task-line", - "parent_id" => null, - "sort_order" => 5, - ], - [ - "name" => "Laporan", - "url" => "/laporan", - "icon" => "mingcute:report-line", - "parent_id" => null, - "sort_order" => 6, - ], - [ - "name" => "Neng Bedas", - "url" => "/chat", - "icon" => "mingcute:wechat-line", - "parent_id" => null, - "sort_order" => 7, - ], - [ - "name" => "Approval", - "url" => "/approval", - "icon" => "mingcute:user-follow-2-line", - "parent_id" => null, - "sort_order" => 8, - ], - [ - "name" => "Tools", - "url" => "/tools", - "icon" => "mingcute:tool-line", - "parent_id" => null, - "sort_order" => 9, - ], - ]; - - foreach ($parent_menus as $parent_menu) { - Menu::firstOrCreate(['name' => $parent_menu['name']], $parent_menu); + // Assign menus to roles + foreach ($permissions as $roleName => $menuNames) { + $role = $roles[$roleName] ?? null; + if ($role) { + $role->menus()->sync( + collect($menuNames)->mapWithKeys(fn($menuName) => [ + $menus[$menuName]->id => ($roleName === 'superadmin' ? $superadminPermissions : + ($roleName === 'admin' ? $adminPermissions : $operatorPermissions)) + ])->toArray() + ); + } } - - // Attach Menus to Roles - $superadmin = Role::where('name', 'superadmin')->first(); - $admin = Role::where('name', 'admin')->first(); - $operator = Role::where('name', 'operator')->first(); - - $dashboard = Menu::where('name', 'Dashboard')->first(); - $master = Menu::where('name', 'Master')->first(); - $settings = Menu::where('name', 'Settings')->first(); - $dataSettings = Menu::where('name', 'Data Settings')->first(); - $data = Menu::where('name', 'Data')->first(); - $laporan = Menu::where('name', 'Laporan')->first(); - $chat_bedas = Menu::where('name', 'Neng Bedas')->first(); - $approval = Menu::where('name', 'Approval')->first(); - $tools = Menu::where('name', 'Tools')->first(); - - // create children menu - $children_menus = [ - [ - "name" => "Dashboard Pimpinan", - "url" => "dashboard.home", - "icon" => null, - "parent_id" => $dashboard->id, - "sort_order" => 1, - ], - [ - "name" => "Dashboard PBG", - "url" => "dashboard.pbg", - "icon" => null, - "parent_id" => $dashboard->id, - "sort_order" => 2, - ], - [ - "name" => "Dashboard Potensi", - "url" => null, - "icon" => null, - "parent_id" => $dashboard->id, - "sort_order" => 3, - ], - [ - "name" => "PETA", - "url" => "dashboard.maps", - "icon" => null, - "parent_id" => $dashboard->id, - "sort_order" => 4, - ], - [ - "name" => "Users", - "url" => "users.index", - "icon" => null, - "parent_id" => $master->id, - "sort_order" => 1, - ], - [ - "name" => "Approval Pejabat", - "url" => "approval-list", - "icon" => null, - "parent_id" => $approval->id, - "sort_order" => 1, - ], - [ - "name" => "Syncronize", - "url" => "settings.syncronize", - "icon" => null, - "parent_id" => $settings->id, - "sort_order" => 1, - ], - [ - "name" => "Menu", - "url" => "menus.index", - "icon" => null, - "parent_id" => $settings->id, - "sort_order" => 2, - ], - [ - "name" => "Role", - "url" => "roles.index", - "icon" => null, - "parent_id" => $settings->id, - "sort_order" => 3, - ], - [ - "name" => "Setting Dashboard", - "url" => "data-settings.index", - "icon" => null, - "parent_id" => $dataSettings->id, - "sort_order" => 1, - ], - [ - "name" => "PBG", - "url" => "pbg-task.index", - "icon" => null, - "parent_id" => $data->id, - "sort_order" => 1, - ], - [ - "name" => "Reklame", - "url" => "web.advertisements.index", - "icon" => null, - "parent_id" => $data->id, - "sort_order" => 2, - ], - [ - "name" => "Usaha atau Industri", - "url" => "business-industries.index", - "icon" => null, - "parent_id" => $data->id, - "sort_order" => 3, - ], - [ - "name" => "UMKM", - "url" => "web-umkm.index", - "icon" => null, - "parent_id" => $data->id, - "sort_order" => 4, - ], - [ - "name" => "Pariwisata", - "url" => "web-tourisms.index", - "icon" => null, - "parent_id" => $data->id, - "sort_order" => 5, - ], - [ - "name" => "Tata Ruang", - "url" => "web-spatial-plannings.index", - "icon" => null, - "parent_id" => $data->id, - "sort_order" => 6, - ], - [ - "name" => "PDAM", - "url" => "customers", - "icon" => null, - "parent_id" => $data->id, - "sort_order" => 7, - ], - [ - "name" => "Google Sheets", - "url" => "google-sheets", - "icon" => null, - "parent_id" => $data->id, - "sort_order" => 8, - ], - [ - "name" => "TPA TPT", - "url" => "tpa-tpt.index", - "icon" => null, - "parent_id" => $data->id, - "sort_order" => 9, - ], - [ - "name" => "Lap Pariwisata", - "url" => "tourisms-report.index", - "icon" => null, - "parent_id" => $laporan->id, - "sort_order" => 1, - ], - [ - "name" => "Lap Pimpinan", - "url" => "bigdata-resumes", - "icon" => null, - "parent_id" => $laporan->id, - "sort_order" => 2, - ], - [ - "name" => "Rekap Pembayaran", - "url" => "payment-recaps", - "icon" => null, - "parent_id" => $laporan->id, - "sort_order" => 3, - ], - [ - "name" => "Lap Rekap Data Pembayaran", - "url" => "report-payment-recaps", - "icon" => null, - "parent_id" => $laporan->id, - "sort_order" => 4, - ], - [ - "name" => "Lap PBG (PTSP)", - "url" => "report-pbg-ptsp", - "icon" => null, - "parent_id" => $laporan->id, - "sort_order" => 5, - ], - [ - "name" => "Chat", - "url" => "main-chatbot.index", - "icon" => null, - "parent_id" => $chat_bedas->id, - "sort_order" => 1, - ], - [ - "name" => "Luar Sistem", - "url" => "dashboard.potentials.inside_system", - "icon" => null, - "parent_id" => Menu::where('name', 'Dashboard Potensi')->first()->id, - "sort_order" => 1, - ], - [ - "name" => "Dalam Sistem", - "url" => "dashboard.potentials.outside_system", - "icon" => null, - "parent_id" => Menu::where('name', 'Dashboard Potensi')->first()->id, - "sort_order" => 2, - ], - [ - "name" => "Undangan", - "url" => "invitations", - "icon" => null, - "parent_id" => $tools->id, - "sort_order" => 1, - ], - ]; - - foreach ($children_menus as $child_menu) { - Menu::firstOrCreate(['name' => $child_menu['name']], $child_menu); - } - - $dashboard_pimpinan = Menu::where('name', 'Dashboard Pimpinan')->first(); - $dashboard_pbg = Menu::where('name', 'Dashboard PBG')->first(); - $users = Menu::where('name', 'Users')->first(); - $syncronize = Menu::where('name', 'Syncronize')->first(); - $setting_menu = Menu::where('name', 'Menu')->first(); - $setting_role = Menu::where('name', 'Role')->first(); - $setting_dashboard = Menu::where('name', 'Setting Dashboard')->first(); - $setting_pbg = Menu::where('name', 'PBG')->first(); - $reklame = Menu::where('name', 'Reklame')->first(); - $businessIndustries = Menu::where('name', 'Usaha atau Industri')->first(); - $pariwisata = Menu::where('name', 'Pariwisata')->first(); - $laporan_pariwisata = Menu::where('name', 'Lap Pariwisata')->first(); - $umkm = Menu::where('name', 'UMKM')->first(); - $lack_of_potentials = Menu::where('name', 'Dashboard Potensi')->first(); - $spatial_plannings = Menu::where('name', 'Tata Ruang')->first(); - $pdam = Menu::where('name', 'PDAM')->first(); - $peta = Menu::where('name', 'PETA')->first(); - $bigdata_resume = Menu::where('name', 'Lap Pimpinan')->first(); - $chatbot = Menu::where('name', 'Chat')->first(); - $dalam_sistem = Menu::where('name', 'Dalam Sistem')->first(); - $luar_sistem = Menu::where('name', 'Luar Sistem')->first(); - $google_sheets = Menu::where('name', 'Google Sheets')->first(); - $tpa_tpt = Menu::where('name', 'TPA TPT')->first(); - $approval_pejabat = Menu::where('name', 'Approval Pejabat')->first(); - $intivations = Menu::where('name', 'Undangan')->first(); - $payment_recap = Menu::where('name', 'Rekap Pembayaran')->first(); - $report_payment_recap = Menu::where('name', 'Lap Rekap Data Pembayaran')->first(); - $report_pbg_ptsp = Menu::where('name', 'Lap PBG (PTSP)')->first(); - - // Superadmin gets all menus - $superadmin->menus()->sync([ - // parent - $dashboard->id => ["allow_show" => true, "allow_create" => false, "allow_update" => false, "allow_destroy" => false], - $master->id => ["allow_show" => true, "allow_create" => false, "allow_update" => false, "allow_destroy" => false], - $settings->id => ["allow_show" => true, "allow_create" => false, "allow_update" => false, "allow_destroy" => false], - $dataSettings->id => ["allow_show" => true, "allow_create" => false, "allow_update" => false, "allow_destroy" => false], - $data->id => ["allow_show" => true, "allow_create" => false, "allow_update" => false, "allow_destroy" => false], - $laporan->id => ["allow_show" => true, "allow_create" => false, "allow_update" => false, "allow_destroy" => false], - $chat_bedas->id => ["allow_show" => true, "allow_create" => false, "allow_update" => false, "allow_destroy" => false], - $approval->id => ["allow_show" => true, "allow_create" => false, "allow_update" => false, "allow_destroy" => false], - $tools->id => ["allow_show" => true, "allow_create" => false, "allow_update" => false, "allow_destroy" => false], - // children - $dashboard_pimpinan->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $dashboard_pbg->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $users->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $syncronize->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $setting_menu->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $setting_role->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $setting_dashboard->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $setting_pbg->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $reklame->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $businessIndustries->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $pariwisata->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $laporan_pariwisata->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $umkm->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $lack_of_potentials->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $spatial_plannings->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $pdam->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - // $peta->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $dalam_sistem->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $luar_sistem->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $bigdata_resume->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $chatbot->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $google_sheets->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $tpa_tpt->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $approval_pejabat->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $intivations->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $payment_recap->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $report_payment_recap->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $report_pbg_ptsp->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - ]); - - // Admin gets limited menus - $admin->menus()->sync([ - $dashboard->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $master->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $settings->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - ]); - - // Operator gets only basic menus with full permissions - $operator->menus()->sync([ - $dashboard->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - $data->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true], - ]); // Attach User to role super admin - User::findOrFail(1)->roles()->sync([$superadmin->id]); + User::findOrFail(1)->roles()->sync([$roles['superadmin']->id]); } } diff --git a/resources/views/errors/503.blade.php b/resources/views/errors/503.blade.php new file mode 100644 index 0000000..f729f25 --- /dev/null +++ b/resources/views/errors/503.blade.php @@ -0,0 +1,41 @@ +@extends('layouts.base', ['subtitle' => 'Service Unavailable - 503']) + +@section('body-attribuet') +class="authentication-bg" +@endsection + +@section('content') + +
+
+
+
+
+
+
+
+
+
+ + + auth + +

Service Unavailable!

+

Our site is currently undergoing scheduled maintenance.
Please check back later.

+ + +
+
+
+
+
+
+
+
+
+
+@endsection diff --git a/resources/views/home/index.blade.php b/resources/views/home/index.blade.php index 0267db0..759eba8 100644 --- a/resources/views/home/index.blade.php +++ b/resources/views/home/index.blade.php @@ -4,8 +4,22 @@ @include('layouts.partials/page-title', ['title' => 'Home', 'subtitle' => 'Home']) -@endsection +
+
+
+
+

Selamat Datang di SIBEDAS PBG!

+

+ Sistem Informasi Berbasis Data (SIBEDAS) adalah sebuah sistem yang dirancang untuk mengelola dan mengolah data pegawai secara efektif dan efisien. + Dengan teknologi modern, SIBEDAS memungkinkan pegawai untuk mendata, melihat, dan memanipulasi informasi pegawai dengan mudah. +

+

+ PBG (Pegawai Badan Kepegawaian) merupakan unit kerja yang bertanggung jawab atas administrasi kepegawaian. + Melalui SIBEDAS PBG, proses manajemen data pegawai menjadi lebih terstruktur, transparan, dan mudah diakses kapan saja. +

+
+
+
+
-@section('scripts') -@vite(['resources/js/pages/dashboard.js']) @endsection \ No newline at end of file diff --git a/resources/views/pages/404-alt.blade.php b/resources/views/pages/404-alt.blade.php index 305f746..288d4e5 100755 --- a/resources/views/pages/404-alt.blade.php +++ b/resources/views/pages/404-alt.blade.php @@ -20,7 +20,7 @@ missing in the digital wilderness.

- Back to Home + Back to Home
diff --git a/resources/views/pages/404.blade.php b/resources/views/pages/404.blade.php index 4d31d01..0543649 100755 --- a/resources/views/pages/404.blade.php +++ b/resources/views/pages/404.blade.php @@ -32,7 +32,7 @@ class="authentication-bg"

The page you're trying to reach seems to have gone
missing in the digital wilderness.

- Back to Home + Back to Home
diff --git a/routes/web.php b/routes/web.php index baaa390..73e6804 100755 --- a/routes/web.php +++ b/routes/web.php @@ -37,7 +37,7 @@ require __DIR__ . '/auth.php'; Route::group(['middleware' => 'auth'], function(){ Route::get('', [BigDataController::class, 'index'])->name('any'); - Route::get('/home', [HomeController::class, 'index']); + Route::get('/home', [HomeController::class, 'index'])->name('home'); //dashboards Route::group(['prefix' => '/dashboards'], function(){