64 lines
1.5 KiB
PHP
Executable File
64 lines
1.5 KiB
PHP
Executable File
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Menu;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class MenuSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
$menus = [
|
|
[
|
|
'name' => 'Produk',
|
|
'link' => 'products.index'
|
|
],
|
|
[
|
|
'name' => 'Kategori Produk',
|
|
'link' => 'product_categories.index'
|
|
],
|
|
[
|
|
'name' => 'Mutasi Produk',
|
|
'link' => 'mutations.index'
|
|
],
|
|
[
|
|
'name' => 'Stock Opname',
|
|
'link' => 'opnames.index'
|
|
],
|
|
[
|
|
'name' => 'Histori Stock',
|
|
'link' => 'stock-audit.index'
|
|
],
|
|
[
|
|
'name' => 'Target',
|
|
'link' => 'kpi.targets.index'
|
|
],
|
|
[
|
|
'name' => 'Stock Produk',
|
|
'link' => 'reports.stock-product.index'
|
|
],
|
|
[
|
|
'name' => 'Teknisi',
|
|
'link' => 'reports.technician.index'
|
|
]
|
|
];
|
|
|
|
foreach ($menus as $menu){
|
|
Menu::updateOrInsert(
|
|
['link' => $menu['link']],
|
|
[
|
|
'name' => $menu['name'],
|
|
'created_at' => now(),
|
|
'updated_at' => now()
|
|
]
|
|
);
|
|
}
|
|
}
|
|
}
|