config/sidebar.php file. Publish it if you haven’t already:
Configuration Options
Caching
Caching Methods:
null- No caching, sidebar is rebuilt on every requeststatic- Cache the sidebar once for all usersuser-based- Cache per user (useful when authorization differs per user)
For production environments with static sidebars, use
static caching to improve performance.Dimensions
These values are available as CSS variables
--sidebar-width and --sidebar-collapsed-width.
Responsive Breakpoint
- The sidebar is hidden by default
- Opening the sidebar shows it as an overlay
- The sidebar cannot be collapsed (only opened/closed)
Collapsible
false, the collapse functionality is disabled and the sidebar remains at full width.
Full Configuration Example
Environment Variables
You can use environment variables for deployment flexibility:Accessing Configuration
Use the helper functions to access configuration values:Injecting CSS Variables
Use the helper functions to inject CSS variables in your layout:data-* attributes are automatically read by the Alpine.js sidebar store to configure its behavior.
Customizing Views
Publish the views to customize the sidebar rendering:resources/views/vendor/sidebar/:
Example: Customizing the Item View
Clearing the Cache
To clear the sidebar cache, use Laravel’s cache commands:SidebarFlusher service that you can use programmatically: