Installation
Install the package via Composer:Setting Up the Middleware
Add the sidebar resolver middleware to your route group or inbootstrap/app.php:
bootstrap/app.php:
Creating a Sidebar
1. Create a Sidebar Class
Create a class that implements theSidebar contract:
2. Register the Sidebar
Register your sidebar in a service provider using theSidebarManager:
config/app.php or bootstrap/providers.php.
Using the Sidebar
Option 1: Livewire Component
The easiest way to use the sidebar is with the built-in Livewire component:Option 2: Custom Blade Implementation
For full control, use theSidebarRenderer directly:
Alpine.js Store Setup
The sidebar uses an Alpine.js store for state management. Add the store to your JavaScript:resources/js/vendor/sidebar/.
Store API
The sidebar store provides these properties and methods: State properties:
Sidebar visibility (mobile):