Skip to content

Commit a34a63f

Browse files
committed
Update to badaso 2.4.5
1 parent b9a2886 commit a34a63f

File tree

4 files changed

+6
-41
lines changed

4 files changed

+6
-41
lines changed

database/seeders/Badaso/ConfigurationsSeeder.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public function run()
2121
try {
2222
$settings = [
2323
0 => [
24-
'id' => 1,
2524
'key' => 'adminPanelTitle',
2625
'display_name' => 'Admin Panel Title',
2726
'value' => 'Badaso',
@@ -32,7 +31,6 @@ public function run()
3231
'can_delete' => 0,
3332
],
3433
1 => [
35-
'id' => 2,
3634
'key' => 'adminPanelDescription',
3735
'display_name' => 'Admin Panel Description',
3836
'value' => 'Badaso, SPA CRUD Generator',
@@ -43,7 +41,6 @@ public function run()
4341
'can_delete' => 0,
4442
],
4543
2 => [
46-
'id' => 3,
4744
'key' => 'adminPanelLogo',
4845
'display_name' => 'Admin Panel Logo',
4946
'value' => 'photos/shares/logo.webp',
@@ -54,7 +51,6 @@ public function run()
5451
'can_delete' => 0,
5552
],
5653
3 => [
57-
'id' => 4,
5854
'key' => 'adminPanelHeaderColor',
5955
'display_name' => 'Admin Panel Header Color',
6056
'value' => '#ffffff',
@@ -65,7 +61,6 @@ public function run()
6561
'can_delete' => 0,
6662
],
6763
4 => [
68-
'id' => 5,
6964
'key' => 'adminPanelHeaderFontColor',
7065
'display_name' => 'Admin Panel Header Font Color',
7166
'value' => '#06bbd3',
@@ -76,7 +71,6 @@ public function run()
7671
'can_delete' => 0,
7772
],
7873
5 => [
79-
'id' => 6,
8074
'key' => 'adminPanelVerifyEmail',
8175
'display_name' => 'Should verify email after register',
8276
'value' => '0',
@@ -87,7 +81,6 @@ public function run()
8781
'can_delete' => 0,
8882
],
8983
6 => [
90-
'id' => 7,
9184
'key' => 'adminPanelLogoConfig',
9285
'display_name' => 'Admin Panel Logo Config',
9386
'value' => 'logo_only',
@@ -98,7 +91,6 @@ public function run()
9891
'can_delete' => 0,
9992
],
10093
7 => [
101-
'id' => 8,
10294
'key' => 'favicon',
10395
'display_name' => 'Favicon',
10496
'value' => 'photos/shares/favicon.png',
@@ -109,7 +101,6 @@ public function run()
109101
'can_delete' => 0,
110102
],
111103
8 => [
112-
'id' => 9,
113104
'key' => 'maintenance',
114105
'display_name' => 'Maintenance for all pages.',
115106
'value' => '0',
@@ -120,7 +111,6 @@ public function run()
120111
'can_delete' => 0,
121112
],
122113
9 => [
123-
'id' => 10,
124114
'key' => 'authBackgroundImage',
125115
'display_name' => 'Background image for login page.',
126116
'value' => 'photos/shares/auth-bg.jpg',
@@ -131,7 +121,6 @@ public function run()
131121
'can_delete' => 0,
132122
],
133123
10 => [
134-
'id' => 11,
135124
'key' => 'maintenanceImage',
136125
'display_name' => 'Image for maintenance page',
137126
'value' => 'photos/shares/maintenance.png',

database/seeders/Badaso/FixedMenuItemSeeder.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public function run()
2525
$menu_items = [
2626
// core menu
2727
0 => [
28-
'id' => 1,
2928
'menu_id' => $menu_core,
3029
'title' => 'Permission Management',
3130
'url' => '/permission',
@@ -37,7 +36,6 @@ public function run()
3736
'permissions' => 'browse_permissions',
3837
],
3938
1 => [
40-
'id' => 2,
4139
'menu_id' => $menu_core,
4240
'title' => 'Role Management',
4341
'url' => '/role',
@@ -49,7 +47,6 @@ public function run()
4947
'permissions' => 'browse_roles',
5048
],
5149
2 => [
52-
'id' => 3,
5350
'menu_id' => $menu_core,
5451
'title' => 'User Management',
5552
'url' => '/user',
@@ -61,7 +58,6 @@ public function run()
6158
'permissions' => 'browse_users',
6259
],
6360
3 => [
64-
'id' => 4,
6561
'menu_id' => $menu_core,
6662
'title' => 'Menu Management',
6763
'url' => '/menu',
@@ -73,7 +69,6 @@ public function run()
7369
'permissions' => 'browse_menus',
7470
],
7571
4 => [
76-
'id' => 5,
7772
'menu_id' => $menu_core,
7873
'title' => 'CRUD Management',
7974
'url' => '/crud',
@@ -85,7 +80,6 @@ public function run()
8580
'permissions' => 'browse_crud_data',
8681
],
8782
5 => [
88-
'id' => 6,
8983
'menu_id' => $menu_core,
9084
'title' => 'Database Management',
9185
'url' => '/database',
@@ -97,7 +91,6 @@ public function run()
9791
'permissions' => 'browse_database',
9892
],
9993
6 => [
100-
'id' => 7,
10194
'menu_id' => $menu_core,
10295
'title' => 'Configuration',
10396
'url' => '/configuration',
@@ -109,7 +102,6 @@ public function run()
109102
'permissions' => 'browse_configurations',
110103
],
111104
7 => [
112-
'id' => 8,
113105
'menu_id' => $menu_core,
114106
'title' => 'Activity Log',
115107
'url' => '/activity-log',
@@ -121,7 +113,6 @@ public function run()
121113
'permissions' => 'browse_activitylogs',
122114
],
123115
8 => [
124-
'id' => 9,
125116
'menu_id' => $menu_core,
126117
'title' => 'Log Viewer',
127118
'url' => '/log-viewer',
@@ -133,7 +124,6 @@ public function run()
133124
'permissions' => 'browse_logviewer',
134125
],
135126
9 => [
136-
'id' => 10,
137127
'menu_id' => $menu_core,
138128
'title' => 'API Documentation',
139129
'url' => '/api-docs',
@@ -147,7 +137,6 @@ public function run()
147137

148138
// media manager
149139
10 => [
150-
'id' => 11,
151140
'menu_id' => $menu_core,
152141
'title' => 'Media Manager',
153142
'url' => '#',
@@ -159,7 +148,6 @@ public function run()
159148
'permissions' => '',
160149
],
161150
11 => [
162-
'id' => 12,
163151
'menu_id' => $menu_core,
164152
'title' => 'Files',
165153
'url' => '/file-manager',
@@ -171,7 +159,6 @@ public function run()
171159
'permissions' => 'browse_file_manager',
172160
],
173161
12 => [
174-
'id' => 13,
175162
'menu_id' => $menu_core,
176163
'title' => 'Images',
177164
'url' => '/image-manager',
@@ -185,7 +172,6 @@ public function run()
185172

186173
// general menu
187174
13 => [
188-
'id' => 14,
189175
'menu_id' => $menu_general,
190176
'title' => 'Dashboard',
191177
'url' => '/home',
@@ -204,11 +190,6 @@ public function run()
204190
->where('url', $value['url'])
205191
->first();
206192

207-
if (isset($menu_item)) {
208-
continue;
209-
}
210-
211-
$menu_item = MenuItem::find($value['id']);
212193
if (isset($menu_item)) {
213194
$menu_item->update($value);
214195
} else {

database/seeders/Badaso/MenusSeeder.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ public function run()
2121
try {
2222
$menus = [
2323
0 => [
24-
'id' => 1,
2524
'key' => 'general',
2625
'display_name' => 'General Menu',
2726
],
2827
1 => [
29-
'id' => 2,
3028
'key' => 'core',
3129
'display_name' => 'Core',
3230
],
@@ -35,11 +33,11 @@ public function run()
3533
$new_menus = [];
3634
foreach ($menus as $key => $value) {
3735
$menu = Menu::where('key', $value['key'])->first();
38-
3936
if (isset($menu)) {
40-
continue;
37+
$menu->update($value);
38+
} else {
39+
Menu::create($value);
4140
}
42-
Menu::create($value);
4341
}
4442
} catch (Exception $e) {
4543
throw new Exception('Exception occur '.$e);

database/seeders/Badaso/RolesSeeder.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ public function run()
2121
try {
2222
$roles = [
2323
0 => [
24-
'id' => 1,
2524
'name' => 'administrator',
2625
'display_name' => 'Administrator',
2726
],
2827
1 => [
29-
'id' => 2,
3028
'name' => 'customer',
3129
'display_name' => 'Customer',
3230
],
@@ -35,12 +33,11 @@ public function run()
3533
$new_roles = [];
3634
foreach ($roles as $key => $value) {
3735
$role = Role::where('name', $value['name'])->first();
38-
3936
if (isset($role)) {
40-
continue;
37+
$role->update($value);
38+
} else {
39+
Role::create($value);
4140
}
42-
43-
Role::create($value);
4441
}
4542

4643
\DB::commit();

0 commit comments

Comments
 (0)