✏️ 编辑:MenuItemSeeder.php
路径:
/home/boguraj1/public_html/udoktaecom/database/seeders/MenuItemSeeder.php
大小:2.51 KB · 修改:2026-07-23 22:13:46 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php namespace Database\Seeders; use App\Models\MenuItem; use Illuminate\Database\Seeder; class MenuItemSeeder extends Seeder { public function run() { $items = [ // Header menu ['label' => 'Home', 'url' => '/', 'route_name' => 'home', 'location' => 'header', 'icon' => 'bi-house', 'sort_order' => 1], ['label' => 'Shop', 'url' => '/shop', 'route_name' => 'shop', 'location' => 'header', 'icon' => 'bi-shop', 'sort_order' => 2], ['label' => 'Blog', 'url' => '/blog', 'route_name' => 'blog.index','location' => 'header', 'icon' => 'bi-journal-text', 'sort_order' => 3], ['label' => 'Track Order', 'url' => '/tracking', 'route_name' => 'tracking', 'location' => 'header', 'icon' => 'bi-geo-alt', 'sort_order' => 4], ['label' => 'Contact', 'url' => '/contact', 'route_name' => 'contact', 'location' => 'header', 'icon' => 'bi-telephone', 'sort_order' => 5], // Footer quick links ['label' => 'Home', 'url' => '/', 'route_name' => 'home', 'location' => 'footer_quick', 'icon' => null, 'sort_order' => 1], ['label' => 'Shop', 'url' => '/shop', 'route_name' => 'shop', 'location' => 'footer_quick', 'icon' => null, 'sort_order' => 2], ['label' => 'Blog', 'url' => '/blog', 'route_name' => 'blog.index','location' => 'footer_quick', 'icon' => null, 'sort_order' => 3], ['label' => 'Contact', 'url' => '/contact', 'route_name' => 'contact', 'location' => 'footer_quick', 'icon' => null, 'sort_order' => 4], // Footer customer service ['label' => 'Track Your Order', 'url' => '/tracking', 'route_name' => 'tracking', 'location' => 'footer_customer', 'icon' => null, 'sort_order' => 1], ['label' => 'Shopping Cart', 'url' => '/cart', 'route_name' => 'cart', 'location' => 'footer_customer', 'icon' => null, 'sort_order' => 2], ['label' => 'Checkout', 'url' => '/checkout', 'route_name' => 'checkout', 'location' => 'footer_customer', 'icon' => null, 'sort_order' => 3], ]; foreach ($items as $item) { MenuItem::updateOrCreate( ['label' => $item['label'], 'location' => $item['location']], $item + ['target' => '_self', 'is_enabled' => true] ); } } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF