Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Collapsible Subnav Laravel Package

emuniq/filament-collapsible-subnav

Filament v3–v5 plugin that adds a collapsible toggle to resource page sub-navigation sidebars (secondary nav), working with both top navigation and sidebar layouts. Auto-registers to all panels with zero configuration; optional theme CSS bundling.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Modular Plugin Design: Aligns with Filament’s plugin ecosystem, enabling isolated adoption without core framework modifications. Ideal for TPMs prioritizing incremental UX improvements (e.g., collapsible sub-nav) without architectural overhaul.
  • Version Agnosticism: Supports Filament v3–v5 with zero breaking changes, reducing lock-in risk for teams in transition. The plugin’s auto-registration model minimizes manual configuration, aligning with DevOps-friendly deployment pipelines.
  • Sub-Navigation Focus: Targets secondary navigation (resource pages), avoiding conflicts with primary panel layouts. This granularity is critical for multi-tenant SaaS or modular admin panels where navigation hierarchies vary by user role.
  • State Persistence: Uses server-side cookies (not localStorage) for collapsed state, ensuring compatibility with SSR, SPAs, and hybrid modes. This is a non-negotiable for enterprise apps with mixed rendering strategies.

Integration Feasibility

  • Zero-Config Default: Auto-registers to all panels, reducing onboarding friction for new Filament projects. One-line composer install (composer require emuniq/filament-collapsible-subnav) meets TPM velocity requirements for rapid prototyping.
  • Optional Theme Integration: Provides a performance optimization path (php artisan collapsible-subnav:install) without mandating it. This caters to high-traffic apps (e.g., dashboards with 10K+ MAU) where HTTP request reduction is critical.
  • Manual Override Support: Allows panel-specific registration (e.g., ->plugin(CollapsibleSubnavPlugin::make())), enabling A/B testing or feature flags for gradual rollout. Critical for data-driven product teams.
  • SPA/Livewire Compatibility: Explicitly handles Livewire SPA mode via livewire:navigated listener, ensuring real-time state sync. This is a must-have for collaborative admin panels (e.g., shared dashboards).

Technical Risk

  • Filament v5 Edge Cases: While v5 is supported, new sidebar classes (e.g., .fi-sidebar-item-badge-ctn) may require future updates if Filament alters its DOM structure. Mitigation: Monitor Filament’s release notes and test against v5’s beta/RC channels.
  • CSS Conflicts: Inline CSS injection (for FOUC prevention) could clash with custom Filament themes. Mitigation: Use the optional theme integration to bundle CSS with your app’s assets, reducing specificity wars.
  • Cookie Dependencies: Relies on server-side cookies for state persistence. Mitigation: Ensure your app’s cookie domain/path is configured to support cross-subdomain Filament panels (common in multi-tenant SaaS).
  • Mobile Responsiveness: Hides sub-nav on <768px by default. Risk: May break UX for mobile-first apps if not tested. Mitigation: Validate with real devices (not emulators) and adjust the breakpoint if needed.

Key Questions for TPMs

  1. Adoption Scope:
    • Should this be globally enabled (auto-register) or opt-in per panel (manual registration)?
    • Example: Enable for resource-heavy panels (e.g., Posts, Users) but exclude simple CRUD pages.
  2. Performance Tradeoffs:
    • Will the optional theme integration (npm run build) be worth the build step overhead for your team’s CI/CD pipeline?
  3. SPA Reliability:
    • Does your app use Livewire SPA mode? If yes, verify the livewire:navigated listener works with your custom Livewire event handlers.
  4. Accessibility:
    • Are screen readers a priority for your admin panel? If so, test the new aria-label additions.
  5. Future-Proofing:
    • Are you planning to upgrade Filament v3/v4 to v5? This package supports the transition with zero code changes.
  6. Vendor Lock-In:
    • Does your team prefer open-source-only packages? This is MIT-licensed with GitHub Sponsors for support (low risk, but note Emuniq’s commercial backing).

Integration Approach

Stack Fit

  • Filament v3–v5: Native support with no version-specific forks. The plugin’s auto-detection of Filament version ensures seamless integration across major releases.
  • Laravel 10–13: PHP 8.1+ constraint aligns with Laravel’s LTS support window, reducing dependency drift risks.
  • Livewire/Alpine: Leverages Alpine.js for interactivity (e.g., toggle button) but falls back to vanilla JS where needed (e.g., livewire:navigated listener). This progressive enhancement approach works even if Alpine is partially disabled.
  • CSS Frameworks: Uses Filament’s built-in classes (e.g., .fi-sidebar-item-btn) for styling, ensuring visual consistency without requiring Tailwind/Bootstrap.

Migration Path

  1. Assessment Phase:
    • Audit existing Filament panels for sub-navigation usage (target: resource pages with ->subNavigationPosition(SubNavigationPosition::Start)).
    • Identify high-traffic panels (e.g., dashboards) where collapsible sub-nav could reduce cognitive load.
  2. Pilot Deployment:
    • Manual Registration: Test on a single panel using ->plugin(CollapsibleSubnavPlugin::make()) to validate UX and performance.
    • SPA Validation: If using Livewire SPA, test navigation state persistence across routes (e.g., collapse sub-nav on Posts page, navigate to Posts/Edit—should remain collapsed).
  3. Global Rollout:
    • Auto-Registration: Remove manual registration and rely on the plugin’s auto-discovery for all panels.
    • Theme Integration (Optional): Run php artisan collapsible-subnav:install and npm run build to bundle CSS for high-traffic apps.
  4. Accessibility Audit:
    • Verify aria-label and dark-mode tooltips work with your screen reader and color scheme settings.

Compatibility

  • Filament v5: Explicitly tested; handles new sidebar classes (e.g., .fi-sidebar-item-badge-ctn) and v5’s tooltip system.
  • SPA Mode: Fixed livewire:navigated desync issues; state now persists across Livewire SPA navigations.
  • Dark Mode: Tooltips respect Filament’s dark class; no manual CSS overrides needed.
  • Mobile: Sub-nav hides below 768px by default. Customize the breakpoint in the plugin’s CSS if your app targets smaller screens.
  • CDN/Minifiers: Inline script uses data-cfasync="false" to bypass Cloudflare Rocket Loader stripping. Test with your HTML minifier to ensure attribute preservation.

Sequencing

  1. Pre-Install:
    • Backup your Filament panels’ custom CSS/JS (if any) to avoid conflicts.
    • Test in a staging environment with a clone of production data (sub-nav behavior may vary by user roles).
  2. Installation:
    composer require emuniq/filament-collapsible-subnav
    # Optional: For performance
    php artisan collapsible-subnav:install
    npm run build
    
  3. Validation:
    • Visual Regression: Compare sub-nav appearance before/after on key panels (e.g., Posts, Users).
    • Functional Testing:
      • Toggle collapse/expand on desktop and mobile.
      • Navigate between pages in SPA mode (if applicable).
    • Performance: Check Lighthouse scores for any layout shift or render-blocking issues.
  4. Post-Launch:
    • Monitor error logs for data-cfasync or cookie-related issues.
    • Gather user feedback on tooltip visibility and mobile UX.

Operational Impact

Maintenance

  • Low Overhead: Zero configuration required; auto-registers to all panels. Updates can be applied via composer update.
  • Dependency Updates:
    • Filament v5: No action needed—plugin supports it out of the box.
    • PHP 8.2+: Test if your app uses new PHP features that might affect the plugin’s JS/CSS (unlikely, but verify).
  • Troubleshooting:
    • Tooltips Missing: Check if Filament v4/v5’s tooltip system is interfering (plugin falls back to CSS-only).
    • SPA Desync: Ensure no **custom
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor