update
This commit is contained in:
@@ -170,9 +170,14 @@ class NavigationSeeder extends Seeder
|
||||
// ['title' => 'Prescription', 'path' => '/report/prescription'],
|
||||
[
|
||||
'title' => 'Doctor Rating',
|
||||
'path' => '/report/doctorrating',
|
||||
'path' => '/report/doctor-rating',
|
||||
'permission' => 'report-doctor-rating'
|
||||
],
|
||||
[
|
||||
'title' => 'Katalog Dokter',
|
||||
'path' => '/report/katalog-dokter',
|
||||
'permission' => 'report-katalog-dokter'
|
||||
]
|
||||
],
|
||||
'permission' => null
|
||||
],
|
||||
@@ -261,30 +266,46 @@ class NavigationSeeder extends Seeder
|
||||
],
|
||||
'permission' => 'case-management-client-portal'
|
||||
],
|
||||
[
|
||||
'title' => 'User Management',
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'User Role',
|
||||
'path' => '/user-role',
|
||||
'permission' => 'user-role-list-client-portal'
|
||||
],
|
||||
[
|
||||
'title' => 'User Access',
|
||||
'path' => '/user-access',
|
||||
'permission' => 'user-access-list-client-portal'
|
||||
]
|
||||
],
|
||||
'permission' => 'user-management-client-portal'
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($menuItems as $menuItemData) {
|
||||
$menuItem = Navigations::updateOrCreate([
|
||||
'title' => $menuItemData['title'],
|
||||
'permission' => $menuItemData['permission']
|
||||
'permission' => $menuItemData['permission'] ?? null
|
||||
],
|
||||
[
|
||||
'title' => $menuItemData['title'],
|
||||
'path' => $menuItemData['path'] ?? null,
|
||||
'permission' => $menuItemData['permission']
|
||||
'permission' => $menuItemData['permission'] ?? null
|
||||
]);
|
||||
|
||||
if (isset($menuItemData['children'])) {
|
||||
foreach ($menuItemData['children'] as $childData) {
|
||||
$menuItemChildren = Navigations::updateOrCreate([
|
||||
'title' => $childData['title'],
|
||||
'permission' => $childData['permission']
|
||||
'permission' => $childData['permission'] ?? null
|
||||
],
|
||||
[
|
||||
'title' => $childData['title'],
|
||||
'path' => $childData['path'] ?? null,
|
||||
'parent_id' => $menuItem->id,
|
||||
'permission' => $childData['permission']
|
||||
'permission' => $childData['permission'] ?? null
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user