定制 shuxx/filament-navigation 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

shuxx/filament-navigation

Composer 安装命令:

composer require shuxx/filament-navigation

包简介

Configure Filament navigation via a simple PHP config file with groups, links, and 24+ separator styles - no manual navigation building required!

README 文档

README

Filament Navigation Banner

Latest Version Total Downloads License Tests PHPStan

Configure your Filament navigation via a simple PHP configuration file - no manual navigation building required!

Perfect for applications where navigation needs to be easily manageable, version-controlled, and consistent across environments.

✨ Features

  • Simple Configuration - Define navigation in a clean PHP config file
  • Full Control - Groups, direct links, and visual separators
  • 24 Separator Styles - From classic lines to hearts and stars
  • Order Preservation - Array order = display order
  • External Links - Support for external URLs with target="_blank"
  • Icon Support - Full Heroicon support for groups and items
  • No Hover on Separators - Automatically disables hover effects
  • Filament 4 Compatible - Built specifically for Filament 4.x

📦 Installation

Install via composer:

composer require shuxx/filament-navigation

Publish the configuration file:

php artisan vendor:publish --tag="filament-navigation-config"

This creates config/filament-navigation.php.

🚀 Quick Start

1. Register the plugin

In app/Providers/Filament/AdminPanelProvider.php:

use Shuxx\FilamentNavigation\FilamentNavigationPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(FilamentNavigationPlugin::make());
}

2. Configure your navigation

Edit config/filament-navigation.php:

return [
    'items' => [
        // Dashboard
        [
            'type' => 'link',
            'label' => 'Dashboard',
            'url' => '/admin',
            'icon' => 'heroicon-o-home',
        ],

        // Separator
        ['type' => 'separator', 'style' => 'default'],

        // Users Group
        [
            'type' => 'group',
            'label' => 'Users',
            'icon' => 'heroicon-o-user-group',
            'collapsible' => true,
            'items' => [
                ['type' => 'link', 'label' => 'All Users', 'url' => '/admin/users'],
                ['type' => 'link', 'label' => 'Roles', 'url' => '/admin/roles'],
            ],
        ],

        ['type' => 'separator', 'style' => 'dots'],

        // External link
        [
            'type' => 'link',
            'label' => 'Documentation',
            'url' => 'https://filamentphp.com/docs',
            'icon' => 'heroicon-o-book-open',
            'external' => true,
        ],
    ],
];

That's it! Your navigation is now configured. 🎉

📖 Documentation

Available Types

Group

Creates a collapsible navigation group:

[
    'type' => 'group',
    'label' => 'Settings',
    'icon' => 'heroicon-o-cog-6-tooth',
    'collapsible' => true,  // optional, default: true
    'items' => [
        // ... sub-items
    ],
]

Link

Creates a navigation link:

[
    'type' => 'link',
    'label' => 'Dashboard',
    'url' => '/admin/dashboard',
    'icon' => 'heroicon-o-home',  // optional
    'external' => false,  // optional, opens in new tab if true
]

Separator

Creates a visual separator:

[
    'type' => 'separator',
    'style' => 'default',  // optional, see styles below
]

🎨 Separator Styles (24 options)

Classic Lines

  • default → ───────────
  • long → ────────────────
  • double → ═══════════
  • thick → ━━━━━━━━━━━
  • dash → - - - - - - - -
  • underscore → ___________

Dots and Circles

  • dots → • • • • • • • •
  • circle → ○ ○ ○ ○ ○ ○
  • circle-filled → ● ● ● ● ● ●
  • ellipsis → ⋯ ⋯ ⋯ ⋯ ⋯

Geometric Shapes

  • square → ▪ ▪ ▪ ▪ ▪ ▪
  • diamond → ◆ ◆ ◆ ◆ ◆
  • triangle → ▸ ▸ ▸ ▸ ▸ ▸
  • arrow → → → → → →
  • chevron → › › › › › ›

Special Symbols

  • stars → ★ ★ ★ ★ ★
  • hearts → ♥ ♥ ♥ ♥ ♥
  • plus → + + + + + + +
  • cross → ✕ ✕ ✕ ✕ ✕

Waves and Curves

  • wave → ~~~~~~~
  • wavy → 〰〰〰〰〰
  • zigzag → ﹏﹏﹏﹏﹏

Spaces

  • space → (large empty space)
  • blank → · (minimal visible space)

Plugin Options

Disable Separator Hover

By default, separators have hover effects disabled. You can enable them:

FilamentNavigationPlugin::make()
    ->disableSeparatorHover(false)

⚠️ Important Notes

Filament 4 Icon Limitation

In Filament 4, you cannot have icons on both the group AND its items. Choose one:

Option 1 - Icons on groups (recommended):

[
    'type' => 'group',
    'icon' => 'heroicon-o-user-group',  // ✅ Icon here
    'items' => [
        ['label' => 'Users', 'url' => '...'],  // ❌ No icons
    ],
]

Option 2 - Icons on items:

[
    'type' => 'group',
    // ❌ No icon on group
    'items' => [
        ['label' => 'Users', 'icon' => 'heroicon-o-users'],  // ✅ Icons here
    ],
]

Navigation Order

The order of items in your config array is the display order. The plugin transforms everything into navigation groups internally to maintain order control (a Filament 4 requirement).

🧪 Testing

composer test

📝 Changelog

Please see CHANGELOG for recent changes.

📚 Documentation

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING for details on:

  • Reporting bugs
  • Suggesting features
  • Submitting pull requests
  • Development guidelines

💬 Support

Need help or have questions?

🔒 Security

If you discover any security-related issues, please email the author directly instead of using the issue tracker. All security vulnerabilities will be promptly addressed.

💝 Credits

📄 License

The MIT License (MIT). Please see License File for more information.

Made with ❤️ for the Filament community

⭐ Star this repo if you find it helpful!

shuxx/filament-navigation 适用场景与选型建议

shuxx/filament-navigation 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 100 次下载、GitHub Stars 达 6, 最近一次更新时间为 2025 年 11 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「menu」 「navigation」 「laravel」 「sidebar」 「filament」 「filament-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 shuxx/filament-navigation 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 shuxx/filament-navigation 我们能提供哪些服务?
定制开发 / 二次开发

基于 shuxx/filament-navigation 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 100
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 26
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-11