Files
2025-12-03 14:23:33 +01:00

94 lines
2.8 KiB
PHP

<?php
namespace Paymenter\Extensions\Others\NavbarManager\Database\Seeders;
use Illuminate\Database\Seeder;
use Paymenter\Extensions\Others\NavbarManager\Models\NavbarLink;
class NavbarLinkSeeder extends Seeder
{
public function run()
{
// Sample Primary Navbar Links
NavbarLink::create([
'name' => 'Help Center',
'type' => 'primary',
'link_type' => 'url',
'custom_url' => 'https://docs.example.com',
'icon' => 'ri-question-line',
'condition' => 'always_visible',
'sort_order' => 100,
'is_active' => true,
]);
NavbarLink::create([
'name' => 'Status Page',
'type' => 'primary',
'link_type' => 'url',
'custom_url' => 'https://status.example.com',
'icon' => 'ri-pulse-line',
'condition' => 'always_visible',
'sort_order' => 110,
'is_active' => true,
]);
// Sample Account Dropdown Link
NavbarLink::create([
'name' => 'Billing History',
'type' => 'account',
'link_type' => 'route',
'route_name' => 'invoices',
'icon' => 'ri-history-line',
'condition' => 'clients_only',
'sort_order' => 100,
'is_active' => true,
]);
// Sample Dashboard Link
NavbarLink::create([
'name' => 'Knowledge Base',
'type' => 'dashboard',
'link_type' => 'url',
'custom_url' => 'https://kb.example.com',
'icon' => 'ri-book-line',
'condition' => 'clients_only',
'sort_order' => 100,
'is_active' => true,
]);
// Sample with dropdown (parent-child)
$parent = NavbarLink::create([
'name' => 'Resources',
'type' => 'primary',
'link_type' => 'route',
'route_name' => 'home', // fallback
'icon' => 'ri-folder-line',
'condition' => 'always_visible',
'sort_order' => 90,
'is_active' => true,
]);
NavbarLink::create([
'name' => 'Downloads',
'type' => 'primary',
'link_type' => 'path',
'custom_path' => '/downloads',
'parent_id' => $parent->id,
'condition' => 'always_visible',
'sort_order' => 10,
'is_active' => true,
]);
NavbarLink::create([
'name' => 'Documentation',
'type' => 'primary',
'link_type' => 'url',
'custom_url' => 'https://docs.example.com',
'parent_id' => $parent->id,
'condition' => 'always_visible',
'sort_order' => 20,
'is_active' => true,
]);
}
}