Files
aso/database/seeders/NavigationSeeder.php

453 lines
16 KiB
PHP

<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\Navigations;
class NavigationSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$menuItems = [
// Dashboard
[
'title' => 'Dashboard',
'urutan' => 1,
'children' => [
[
'title' => 'Dashboard',
'path' => '/dashboard',
'permission' => 'doctor-list'
],
],
'permission' => 'dashboard',
],
// DOCTORS & HOSPITALS
[
'title' => 'DOCTORS & HOSPITALS',
'urutan' => 2,
'children' => [
[
'title' => 'Doctors',
'path' => '/master/doctors',
'permission' => 'doctor-list'
],
[
'title' => 'Hospitals',
'path' => '/master/hospitals',
'permission' => 'hospital-list'
],
],
'permission' => null
],
// PHARMACY & DELIVERY MANAGEMENT
[
'title' => 'PHARMACY & DELIVERY MANAGEMENT',
'urutan' => 3,
'children' => [
[
'title' => 'Drug',
'path' => '/master/drugs',
'permission' => 'drug-list'
],
[
'title' => 'Inventory',
'path' => '/inventory',
'permission' => null
],
[
'title' => 'Delivery Services',
'path' => '/delivery',
'permission' => null
],
],
'permission' => null
],
// STATION BENEFIT & MEMBERSHIP
[
'title' => 'STATION BENEFIT & MEMBERSHIP',
'urutan' => 4,
'openWhen' => ['/corporates', '/formularium', '/diagnosis', '/hospitals'],
'children' => [
[
'title' => 'Corporate',
'path' => '/corporates',
'permission' => 'corporate-list',
],
[
'title' => 'Formularium',
'path' => '/master/formularium-template-v2',
'permission' => 'formularium-list',
],
[
'title' => 'Master ICD-10 Diagnosis',
'path' => '/master/diagnosis',
'permission' => 'diagnosis-list',
],
[
'title' => 'Hospitals',
'path' => '/hospitals',
'permission' => null,
],
],
'permission' => null
],
// MASTER
[
'title' => 'MASTER',
'urutan' => 5,
'children' => [
[
'title' => 'Diagnosis',
'path' => '/master/diagnosis',
'permission' => 'diagnosis-list'
],
],
'permission' => null
],
// CUSTOMER SERVICES
[
'title' => 'CUSTOMER SERVICES',
'urutan' => 6,
'children' => [
[
'title' => 'Request',
'path' => '/custormer-service/request',
'permission' => 'request-log-list'
],
[
'title' => 'Final LOG',
'path' => '/custormer-service/final-log',
'permission' => 'final-log-list'
],
],
'permission' => null
],
// CASE MANAGEMENT
[
'title' => 'CASE MANAGEMENT',
'urutan' => 7,
'children' => [
[
'title' => 'Daily Monitoring',
'path' => '/case_management/daily_monitoring',
'permission' => 'daily-monitoring-list'
],
[
'title' => 'Inpatient Monitoring',
'path' => '/case_management/inpatient_monitoring',
'permission' => 'final-log-list'
],
[
'title' => 'Approval Inpatient',
'path' => '/case_management/approval_inpatient_monitoring',
'permission' => 'approval-log-list'
],
],
'permission' => null
],
// CLAIM REQUEST
[
'title' => 'CLAIM REQUEST',
'urutan' => 8,
'path' => '/claim-requests',
'children' => [
[
'title' => 'CLAIM REQUEST',
'path' => '/claim-requests',
'permission' => 'claim-request-list'
],
],
'permission' => null
],
// CLAIM MANAGEMENT
[
'title' => 'CLAIM MANAGEMENT',
'urutan' => 9,
'path' => '/claims',
'children' => [
[
'title' => 'CLAIM MANAGEMENT',
'path' => '/claims',
'permission' => 'claim-management-list'
],
],
'permission' => null
],
// USER MANAGEMENT
[
'title' => 'USER MANAGEMENT',
'urutan' => 10,
'children' => [
[
'title' => 'User Role',
'path' => '/user-role',
'permission' => 'user-role-list'
],
[
'title' => 'User Access',
'path' => '/user-access',
'permission' => 'user-access-list'
],
],
'permission' => null
],
// INVOICE
[
'title' => 'INVOICE',
'urutan' => 11,
'children' => [
[
'title' => 'Invoice',
'path' => '/invoice-payment',
'permission' => 'invoice-payment-list'
],
],
'permission' => null
],
// REPORT
[
'title' => 'REPORT',
'urutan' => 12,
'children' => [
[
'title' => 'Files Provider',
'path' => 'report/files-provider',
'permission' => 'report-files-provider-list',
'urutan' => 1,
],
[
'title' => 'Letter of Guarantee',
'path' => '/report/logs',
'permission' => 'report-log-list',
'urutan' => 2,
],
[
'title' => 'Appointment',
'path' => '/report/appointments',
'permission' => 'report-appointment-list',
'urutan' => 3,
],
[
'title' => 'Live Chat',
'path' => '/report/live-chat',
'permission' => 'report-livechat-list',
'urutan' => 4,
],
[
'title' => 'Linksehat Payment',
'path' => '/report/linksehat-payments',
'permission' => 'report-livechat-payment',
'urutan' => 5,
],
[
'title' => 'Prescription',
'path' => '/report/prescription',
'permission' => 'report-prescription',
'urutan' => 6,
],
[
'title' => 'Doctor Rating',
'path' => '/report/doctor-rating',
'permission' => 'report-doctor-rating',
'urutan' => 7,
],
[
'title' => 'Doctor Online',
'path' => '/report/doctor-online',
'permission' => 'report-doctor-online',
'urutan' => 8,
],
[
'title' => 'Katalog Dokter',
'path' => '/report/katalog-dokter',
'permission' => 'report-katalog-dokter',
'urutan' => 9,
],
[
'title' => 'Primayan Medicare',
'path' => '/report/primayan-medicare',
'permission' => 'report-primayan-medicare',
'urutan' => 10,
],
],
'permission' => null
],
// MASTER
[
'title' => 'MASTER',
'urutan' => 11,
'children' => [
[
'title' => 'Diagnosis',
'path' => '/master/diagnosis',
'permission' => 'diagnosis-list'
],
],
'permission' => null
],
// USER MANAGEMENT
[
'title' => 'USER MANAGEMENT',
'urutan' => 9,
'children' => [
[
'title' => 'User Role',
'path' => '/user-role',
'permission' => 'user-role-list'
],
[
'title' => 'User Access',
'path' => '/user-access',
'permission' => 'user-access-list'
],
],
'permission' => null
],
// LINKING TOOLS
[
'title' => 'LINKING TOOLS',
'urutan' => 13,
'path' => '/linking',
'permission' => 'linkking-list'
],
// E-PRESCRIPTION
[
'title' => 'E-PRESCRIPTION',
'urutan' => 14,
'path' => '/e-prescription/live-chat',
'permission' => 'prescription-list'
],
####################### CLIENT PORTAL #########################
[
'title' => 'Dashboard',
'children' => [
[
'title' => 'Usage Dashboard',
'path' => '/dashboard',
'permission' => 'dashboard-list-client-portal'
],
],
'permission' => 'dashboard-client-portal'
],
[
'title' => 'Corporate',
'children' => [
[
'title' => 'Corporate',
'path' => '/corporate',
'permission' => 'corporate-list-client-portal'
],
[
'title' => 'Employee Data',
'path' => '/employee-data',
'permission' => 'employee-data-list-client-portal'
],
],
'permission' => 'corporate-client-portal'
],
[
'title' => 'Case Management',
'children' => [
[
'title' => 'Alarm Center',
'path' => '/alarm-center',
'permission' => 'alarm-center-list-client-portal'
],
[
'title' => 'Daily Monitoring',
'path' => '/daily-monitoring',
'permission' => 'daily-monitoring-list-client-portal'
],
[
'title' => 'Formularium',
'path' => '/master/formularium-template-v2',
'permission' => 'formularium-list-client-portal'
],
],
'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'
],
####################### HOSPITAL PORTAL #########################
[
'title' => 'Dashboard',
'path' => '/dashboard',
'icon' => 'dashboard',
'permission' => 'dashboard-hospital-portal'
],
[
'title' => 'Claim',
'path' => '/claim',
'icon' => 'ic_booking',
'permission' => 'dashboard-claim-hospital-portal'
],
[
'title' => 'Request LOG',
'path' => '',
'icon' => '',
'permission' => 'request-log-hospital-portal'
],
####################### CS LMS & APOTEK PORTAL #########################
[
'title' => 'Dashboard',
'path' => '/prescription-orders',
'icon' => 'dashboard',
'permission' => 'dashboard-apotek-portal'
],
];
foreach ($menuItems as $menuItemData) {
$menuItem = Navigations::updateOrCreate([
'title' => $menuItemData['title'],
'permission' => $menuItemData['permission'] ?? null
],
[
'title' => $menuItemData['title'],
'path' => $menuItemData['path'] ?? null,
'icon' => $menuItemData['icon'] ?? null,
'permission' => $menuItemData['permission'] ?? null,
'urutan' => $menuItemData['urutan'] ?? null
]);
if (isset($menuItemData['children'])) {
foreach ($menuItemData['children'] as $childData) {
$menuItemChildren = Navigations::updateOrCreate([
'title' => $childData['title'],
'permission' => $childData['permission'] ?? null
],
[
'title' => $childData['title'],
'path' => $childData['path'] ?? null,
'icon' => $childData['icon'] ?? null,
'parent_id' => $menuItem->id,
'permission' => $childData['permission'] ?? null,
'urutan' => $childData['urutan'] ?? null
]);
}
}
}
}
}