Skip to content

Commit

Permalink
Update to badaso 2.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
rizkiheryandi committed Feb 15, 2022
1 parent b9a2886 commit a34a63f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 41 deletions.
11 changes: 0 additions & 11 deletions database/seeders/Badaso/ConfigurationsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function run()
try {
$settings = [
0 => [
'id' => 1,
'key' => 'adminPanelTitle',
'display_name' => 'Admin Panel Title',
'value' => 'Badaso',
Expand All @@ -32,7 +31,6 @@ public function run()
'can_delete' => 0,
],
1 => [
'id' => 2,
'key' => 'adminPanelDescription',
'display_name' => 'Admin Panel Description',
'value' => 'Badaso, SPA CRUD Generator',
Expand All @@ -43,7 +41,6 @@ public function run()
'can_delete' => 0,
],
2 => [
'id' => 3,
'key' => 'adminPanelLogo',
'display_name' => 'Admin Panel Logo',
'value' => 'photos/shares/logo.webp',
Expand All @@ -54,7 +51,6 @@ public function run()
'can_delete' => 0,
],
3 => [
'id' => 4,
'key' => 'adminPanelHeaderColor',
'display_name' => 'Admin Panel Header Color',
'value' => '#ffffff',
Expand All @@ -65,7 +61,6 @@ public function run()
'can_delete' => 0,
],
4 => [
'id' => 5,
'key' => 'adminPanelHeaderFontColor',
'display_name' => 'Admin Panel Header Font Color',
'value' => '#06bbd3',
Expand All @@ -76,7 +71,6 @@ public function run()
'can_delete' => 0,
],
5 => [
'id' => 6,
'key' => 'adminPanelVerifyEmail',
'display_name' => 'Should verify email after register',
'value' => '0',
Expand All @@ -87,7 +81,6 @@ public function run()
'can_delete' => 0,
],
6 => [
'id' => 7,
'key' => 'adminPanelLogoConfig',
'display_name' => 'Admin Panel Logo Config',
'value' => 'logo_only',
Expand All @@ -98,7 +91,6 @@ public function run()
'can_delete' => 0,
],
7 => [
'id' => 8,
'key' => 'favicon',
'display_name' => 'Favicon',
'value' => 'photos/shares/favicon.png',
Expand All @@ -109,7 +101,6 @@ public function run()
'can_delete' => 0,
],
8 => [
'id' => 9,
'key' => 'maintenance',
'display_name' => 'Maintenance for all pages.',
'value' => '0',
Expand All @@ -120,7 +111,6 @@ public function run()
'can_delete' => 0,
],
9 => [
'id' => 10,
'key' => 'authBackgroundImage',
'display_name' => 'Background image for login page.',
'value' => 'photos/shares/auth-bg.jpg',
Expand All @@ -131,7 +121,6 @@ public function run()
'can_delete' => 0,
],
10 => [
'id' => 11,
'key' => 'maintenanceImage',
'display_name' => 'Image for maintenance page',
'value' => 'photos/shares/maintenance.png',
Expand Down
19 changes: 0 additions & 19 deletions database/seeders/Badaso/FixedMenuItemSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public function run()
$menu_items = [
// core menu
0 => [
'id' => 1,
'menu_id' => $menu_core,
'title' => 'Permission Management',
'url' => '/permission',
Expand All @@ -37,7 +36,6 @@ public function run()
'permissions' => 'browse_permissions',
],
1 => [
'id' => 2,
'menu_id' => $menu_core,
'title' => 'Role Management',
'url' => '/role',
Expand All @@ -49,7 +47,6 @@ public function run()
'permissions' => 'browse_roles',
],
2 => [
'id' => 3,
'menu_id' => $menu_core,
'title' => 'User Management',
'url' => '/user',
Expand All @@ -61,7 +58,6 @@ public function run()
'permissions' => 'browse_users',
],
3 => [
'id' => 4,
'menu_id' => $menu_core,
'title' => 'Menu Management',
'url' => '/menu',
Expand All @@ -73,7 +69,6 @@ public function run()
'permissions' => 'browse_menus',
],
4 => [
'id' => 5,
'menu_id' => $menu_core,
'title' => 'CRUD Management',
'url' => '/crud',
Expand All @@ -85,7 +80,6 @@ public function run()
'permissions' => 'browse_crud_data',
],
5 => [
'id' => 6,
'menu_id' => $menu_core,
'title' => 'Database Management',
'url' => '/database',
Expand All @@ -97,7 +91,6 @@ public function run()
'permissions' => 'browse_database',
],
6 => [
'id' => 7,
'menu_id' => $menu_core,
'title' => 'Configuration',
'url' => '/configuration',
Expand All @@ -109,7 +102,6 @@ public function run()
'permissions' => 'browse_configurations',
],
7 => [
'id' => 8,
'menu_id' => $menu_core,
'title' => 'Activity Log',
'url' => '/activity-log',
Expand All @@ -121,7 +113,6 @@ public function run()
'permissions' => 'browse_activitylogs',
],
8 => [
'id' => 9,
'menu_id' => $menu_core,
'title' => 'Log Viewer',
'url' => '/log-viewer',
Expand All @@ -133,7 +124,6 @@ public function run()
'permissions' => 'browse_logviewer',
],
9 => [
'id' => 10,
'menu_id' => $menu_core,
'title' => 'API Documentation',
'url' => '/api-docs',
Expand All @@ -147,7 +137,6 @@ public function run()

// media manager
10 => [
'id' => 11,
'menu_id' => $menu_core,
'title' => 'Media Manager',
'url' => '#',
Expand All @@ -159,7 +148,6 @@ public function run()
'permissions' => '',
],
11 => [
'id' => 12,
'menu_id' => $menu_core,
'title' => 'Files',
'url' => '/file-manager',
Expand All @@ -171,7 +159,6 @@ public function run()
'permissions' => 'browse_file_manager',
],
12 => [
'id' => 13,
'menu_id' => $menu_core,
'title' => 'Images',
'url' => '/image-manager',
Expand All @@ -185,7 +172,6 @@ public function run()

// general menu
13 => [
'id' => 14,
'menu_id' => $menu_general,
'title' => 'Dashboard',
'url' => '/home',
Expand All @@ -204,11 +190,6 @@ public function run()
->where('url', $value['url'])
->first();

if (isset($menu_item)) {
continue;
}

$menu_item = MenuItem::find($value['id']);
if (isset($menu_item)) {
$menu_item->update($value);
} else {
Expand Down
8 changes: 3 additions & 5 deletions database/seeders/Badaso/MenusSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ public function run()
try {
$menus = [
0 => [
'id' => 1,
'key' => 'general',
'display_name' => 'General Menu',
],
1 => [
'id' => 2,
'key' => 'core',
'display_name' => 'Core',
],
Expand All @@ -35,11 +33,11 @@ public function run()
$new_menus = [];
foreach ($menus as $key => $value) {
$menu = Menu::where('key', $value['key'])->first();

if (isset($menu)) {
continue;
$menu->update($value);
} else {
Menu::create($value);
}
Menu::create($value);
}
} catch (Exception $e) {
throw new Exception('Exception occur '.$e);
Expand Down
9 changes: 3 additions & 6 deletions database/seeders/Badaso/RolesSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ public function run()
try {
$roles = [
0 => [
'id' => 1,
'name' => 'administrator',
'display_name' => 'Administrator',
],
1 => [
'id' => 2,
'name' => 'customer',
'display_name' => 'Customer',
],
Expand All @@ -35,12 +33,11 @@ public function run()
$new_roles = [];
foreach ($roles as $key => $value) {
$role = Role::where('name', $value['name'])->first();

if (isset($role)) {
continue;
$role->update($value);
} else {
Role::create($value);
}

Role::create($value);
}

\DB::commit();
Expand Down

0 comments on commit a34a63f

Please sign in to comment.