emuniq/filament-collapsible-subnav 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

emuniq/filament-collapsible-subnav

最新稳定版本:v1.5.0

Composer 安装命令:

composer require emuniq/filament-collapsible-subnav

包简介

A Filament v3 & v4 plugin for collapsible sub-navigation sidebar.

README 文档

README

A Filament v3 & v4 plugin that adds a collapsible toggle to sub-navigation sidebars only. Perfect for resource pages with multiple tabs or sections using ->subNavigationPosition(SubNavigationPosition::Start).

Works with both top navigation and sidebar navigation layouts - the plugin specifically targets the sub-navigation sidebar that appears on individual resource pages, not the main panel navigation.

Without Top Navigation (Sidebar Layout): Expanded Sidebar

With Top Navigation: Collapsed Sidebar

Requirements

  • PHP 8.1+
  • Laravel 10.0+
  • Filament 3.0+ or 4.0+

Note: This plugin only affects sub-navigation sidebars (the secondary navigation within resource pages), not the main panel sidebar. It works regardless of whether you use top navigation or sidebar navigation for your main panel layout.

Installation

Install the package via composer:

composer require emuniq/filament-collapsible-subnav

That's it! The plugin will auto-register to all panels and work immediately with zero flash.

Optional: Theme Integration

For a slight performance boost, you can integrate the CSS into your Filament theme:

php artisan collapsible-subnav:install
npm run build

This bundles the plugin CSS with your theme, reducing HTTP requests. Not required - the plugin works perfectly without this step.

Features

  • Zero configuration - Auto-registers to all panels
  • ✅ Collapsible sidebar toggle button
  • ✅ Persistent state using cookies
  • ✅ Server-side rendering support (no FOUC)
  • ✅ Responsive design
  • ✅ Smooth animations
  • ✅ No theme, npm, or build step required

How It Works

The plugin automatically:

  1. Registers itself to all Filament panels on installation
  2. Injects CSS styles for the collapsible sidebar
  3. Adds a toggle button to sub-navigation sidebars only (not main panel navigation)
  4. Manages state persistence via cookies
  5. Applies server-side rendering for seamless loading

The plugin detects pages with sub-navigation and only applies to those specific sidebars, leaving your main panel navigation (top or sidebar) untouched.

Manual Registration (Optional)

If you prefer manual control, you can prevent auto-registration and register the plugin manually:

use Emuniq\FilamentCollapsibleSubnav\CollapsibleSubnavPlugin;

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

License

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Blade

其他信息

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