forked from admin/services_core
225 lines
7.1 KiB
PHP
225 lines
7.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\MenuList;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class MenuListSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Seed default menu list for CoreUI navigation.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$users = MenuList::updateOrCreate(
|
|
['slug' => 'users'],
|
|
[
|
|
'parent_id' => null,
|
|
'name' => 'Pengguna',
|
|
'url' => null,
|
|
'icon' => 'cil-user',
|
|
'component' => null,
|
|
'sort_order' => 1,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
MenuList::updateOrCreate(
|
|
['slug' => 'users-user'],
|
|
[
|
|
'parent_id' => $users->id,
|
|
'name' => 'Data Pengguna',
|
|
'url' => '/users',
|
|
'icon' => 'cil-people',
|
|
'component' => null,
|
|
'sort_order' => 1,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
MenuList::updateOrCreate(
|
|
['slug' => 'users-group-menus'],
|
|
[
|
|
'parent_id' => $users->id,
|
|
'name' => 'Grup Menu',
|
|
'url' => '/group-menus',
|
|
'icon' => 'cil-list-rich',
|
|
'component' => null,
|
|
'sort_order' => 2,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
MenuList::updateOrCreate(
|
|
['slug' => 'tenants'],
|
|
[
|
|
'parent_id' => null,
|
|
'name' => 'Tenant',
|
|
'url' => '/tenants',
|
|
'icon' => 'cil-layers',
|
|
'component' => null,
|
|
'sort_order' => 2,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
$ticketing = MenuList::updateOrCreate(
|
|
['slug' => 'ticketing'],
|
|
[
|
|
'parent_id' => null,
|
|
'name' => 'Ticketing',
|
|
'url' => null,
|
|
'icon' => 'cil-description',
|
|
'component' => null,
|
|
'sort_order' => 3,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
MenuList::updateOrCreate(
|
|
['slug' => 'ticketing-material'],
|
|
[
|
|
'parent_id' => $ticketing->id,
|
|
'name' => 'Material',
|
|
'url' => '/materials',
|
|
'icon' => 'cil-layers',
|
|
'component' => null,
|
|
'sort_order' => 1,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
MenuList::updateOrCreate(
|
|
['slug' => 'ticketing-ticket'],
|
|
[
|
|
'parent_id' => $ticketing->id,
|
|
'name' => 'Tiket',
|
|
'url' => '/tickets',
|
|
'icon' => 'cil-ticket',
|
|
'component' => null,
|
|
'sort_order' => 2,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
MenuList::updateOrCreate(
|
|
['slug' => 'ticketing-approval'],
|
|
[
|
|
'parent_id' => $ticketing->id,
|
|
'name' => 'Persetujuan',
|
|
'url' => '/tickets/approval',
|
|
'icon' => 'cil-check-circle',
|
|
'component' => null,
|
|
'sort_order' => 3,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
MenuList::updateOrCreate(
|
|
['slug' => 'ticketing-rejected'],
|
|
[
|
|
'parent_id' => $ticketing->id,
|
|
'name' => 'Ditolak',
|
|
'url' => '/tickets/rejected',
|
|
'icon' => 'cil-x-circle',
|
|
'component' => null,
|
|
'sort_order' => 4,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
MenuList::updateOrCreate(
|
|
['slug' => 'ticketing-ticket-types'],
|
|
[
|
|
'parent_id' => $ticketing->id,
|
|
'name' => 'Jenis Tiket',
|
|
'url' => '/ticket-types',
|
|
'icon' => 'cil-tags',
|
|
'component' => null,
|
|
'sort_order' => 5,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
MenuList::updateOrCreate(
|
|
['slug' => 'ticketing-ticket-incidents'],
|
|
[
|
|
'parent_id' => $ticketing->id,
|
|
'name' => 'Insiden Tiket',
|
|
'url' => '/ticket-incident-types',
|
|
'icon' => 'cil-warning',
|
|
'component' => null,
|
|
'sort_order' => 6,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
$wilayah = MenuList::updateOrCreate(
|
|
['slug' => 'wilayah'],
|
|
[
|
|
'parent_id' => null,
|
|
'name' => 'Wilayah',
|
|
'url' => null,
|
|
'icon' => 'cil-location-pin',
|
|
'component' => null,
|
|
'sort_order' => 4,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
foreach ([
|
|
['slug' => 'wilayah-desa', 'name' => 'Desa', 'url' => '/wilayah/desa', 'sort_order' => 1],
|
|
['slug' => 'wilayah-kecamatan', 'name' => 'Kecamatan', 'url' => '/wilayah/kecamatan', 'sort_order' => 2],
|
|
['slug' => 'wilayah-kabupaten', 'name' => 'Kabupaten', 'url' => '/wilayah/kabupaten', 'sort_order' => 3],
|
|
['slug' => 'wilayah-provinsi', 'name' => 'Provinsi', 'url' => '/wilayah/provinsi', 'sort_order' => 4],
|
|
] as $item) {
|
|
MenuList::updateOrCreate(
|
|
['slug' => $item['slug']],
|
|
[
|
|
'parent_id' => $wilayah->id,
|
|
'name' => $item['name'],
|
|
'url' => $item['url'],
|
|
'icon' => 'cil-location-pin',
|
|
'component' => null,
|
|
'sort_order' => $item['sort_order'],
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
}
|
|
|
|
$nas = MenuList::updateOrCreate(
|
|
['slug' => 'nas'],
|
|
[
|
|
'parent_id' => null,
|
|
'name' => 'NAS',
|
|
'url' => null,
|
|
'icon' => 'cil-settings',
|
|
'component' => null,
|
|
'sort_order' => 5,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
|
|
foreach ([
|
|
['slug' => 'nas-mikrotik', 'name' => 'Mikrotik', 'url' => '/nas/mikrotik', 'icon' => 'cil-settings', 'sort_order' => 1],
|
|
['slug' => 'nas-package-profiles', 'name' => 'Profile Paket', 'url' => '/nas/package-profiles', 'icon' => 'cil-speedometer', 'sort_order' => 2],
|
|
['slug' => 'nas-olt', 'name' => 'OLT', 'url' => '/nas/olt', 'icon' => 'cil-layers', 'sort_order' => 3],
|
|
['slug' => 'nas-webfig', 'name' => 'Webfig', 'url' => '/nas/webfig', 'icon' => 'cil-laptop', 'sort_order' => 4],
|
|
] as $item) {
|
|
MenuList::updateOrCreate(
|
|
['slug' => $item['slug']],
|
|
[
|
|
'parent_id' => $nas->id,
|
|
'name' => $item['name'],
|
|
'url' => $item['url'],
|
|
'icon' => $item['icon'],
|
|
'component' => null,
|
|
'sort_order' => $item['sort_order'],
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
}
|
|
}
|
|
}
|