shopper/sidebar
Headless Laravel sidebar builder with configurable groups, items, icons, weights, nesting, and responsive collapse support. Includes middleware-based sidebar resolution, optional view publishing for customization, and configurable caching (static/user-based) plus width and breakpoint options.
ResolveSidebars), which is a clean way to inject sidebars into routes without cluttering controllers.config/sidebar.php allows alignment with existing project conventions (e.g., caching, dimensions).'method' => 'user-based') could introduce race conditions or stale data if not configured carefully.sidebar-width).composer require shopper/sidebar
php artisan vendor:publish --provider="Shopper\Sidebar\SidebarServiceProvider" --tag="sidebar-config"
config/sidebar.php for caching, dimensions, and breakpoints.'cache' => ['method' => null],
bootstrap/app.php (Laravel 11+) or route groups:
->withMiddleware(\Shopper\Sidebar\Middleware\ResolveSidebars::class)
php artisan vendor:publish --tag="sidebar-views"
@include('sidebar::sidebar') or use the @sidebar directive if supported.sidebar view names, config keys).tinker:
\Shopper\Sidebar\Facades\Sidebar::getSidebar('primary');
cache['duration'] based on traffic patterns.php artisan route:list).'method' => 'static' reduces DB queries but may stale data. 'user-based' adds overhead but personalizes content.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Middleware throws exception | Route group fails | Wrap in try-catch or exclude from middleware. |
| Caching misconfiguration | Stale or missing sidebars | Use 'method' => null in development. |
| DB connection issues | Sidebars fail to load | Fallback to static HTML or empty sidebar. |
| View template errors | Broken UI | Override views or use @if checks in Blade. |
| Laravel version incompatibility | Package fails to load | Pin Laravel version in composer.json. |
php artisan cache:clear.Sidebar::register('dashboard')).How can I help you explore Laravel packages today?