ebess/nova-collapsible-sidebar
ebess/nova-collapsible-sidebar adds a collapsible sidebar to Laravel Nova, letting users hide or expand navigation to free up screen space. The collapsed state is persisted, and it works alongside Nova's standard menu with minimal setup.
Before you type composer require, check the Nova version. This package was last released in October 2018, which puts it squarely in the Nova 2/3 era (Vue 2, Nova::script() / Nova::style() asset injection). Nova 4 moved to Vue 3 + Inertia with a different asset pipeline, so the compiled bundle will very likely inject but never mount. Confirm the constraint first:
composer show laravel/nova | head -3 # your installed major
# then eyeball the "require" block on the GitHub repo root composer.json
If you are on Nova 4+, stop here and hand-roll the CSS — a 30-line override in NovaServiceProvider::boot() plus a localStorage flag gets you the same behaviour without the dependency.
On Nova 2/3, install pinned to the exact patch (see Gotchas for why):
composer require ebess/nova-collapsible-sidebar:0.1.2
php artisan config:clear
php artisan view:clear
The provider is auto-discovered. If the repo ships a publishable config (toggleKeyCode is named in the 0.1.2 changelog, so at least one config surface exists), publish it rather than editing vendor/:
php artisan vendor:publish --provider="Ebess\NovaCollapsibleSidebar\NovaCollapsibleSidebarServiceProvider"
Where to look first: open vendor/ebess/nova-collapsible-sidebar/src/ — the whole package is a service provider plus a small compiled JS/CSS asset. At this maturity the source is the documentation, and you need to know exactly what it registers globally before it reaches production.
First use case: a resource whose index table has 10+ columns. Open it, collapse the sidebar, confirm the table no longer horizontally scrolls, then reload the page and confirm the collapsed state survived. That single round trip tells you whether the package works on your Nova build at all.
Zero-config baseline, guarded rollout. Don't let the package be unconditionally live just because Composer autoloads it. Gate the provider registration so you can disable it in one env var without a deploy:
// app/Providers/AppServiceProvider.php
public function register(): void
{
if (config('nova.collapsible_sidebar', true)) {
$this->app->register(\Ebess\NovaCollapsibleSidebar\NovaCollapsibleSidebarServiceProvider::class);
}
}
(If you go this route, add the provider to composer.json's extra.laravel.dont-discover so it isn't registered twice.)
Tune the keyboard affordance, not the visuals. The one documented capability is toggleKeyCode. Set it to a key that doesn't collide with Nova's global search (/) or the browser's own shortcuts, and write the chosen key into your team's Nova onboarding doc — a collapsed-sidebar state plus an undocumented shortcut is a support ticket generator.
Layer your own CSS on top, never edit vendor assets. Collapsed icon-only strips tend to need padding/tooltip tweaks for your specific logo or nav groups:
// app/Providers/NovaServiceProvider.php
public function boot(): void
{
parent::boot();
Nova::style('nova-sidebar-tweaks', __DIR__.'/../../public/css/nova-sidebar-tweaks.css');
}
Nova::style/Nova::script load after the package's own injection in most setups, so your overrides win without !important gymnastics.
Treat upgrades as integration events. Because there's one bug-fix release and no feature history, an upgrade is not routine. Pattern: branch → composer update ebess/nova-collapsible-sidebar --with-dependencies → click through dashboard, one index, one detail page → screenshot diff the sidebar → merge. Never let this ride along inside a composer update sweep.
Add the smoke test the package doesn't have. A single Dusk test earns its keep here:
$browser->loginAs($admin)
->visit('/nova')
->click('@sidebar-toggle') // inspect the toggle's markup for the real selector
->assertPresent('.sidebar-collapsed') // whatever class the bundle applies
->refresh()
->assertPresent('.sidebar-collapsed'); // proves persistence still works
That test is your regression net for the next Nova bump, and it fails loudly when an asset pipeline change silently orphans the bundle.
laravel/nova, check whether this package still earns its place; budget an afternoon to replace it with a custom toggle if it doesn't.localStorage, not the database. The description says the state is remembered across sessions, and that's client-side storage — per browser, per device, per profile. A user on a second machine, in incognito, or after clearing site data gets the default state back. Don't promise account-level sync in a ticket response.toggleKeyCode with no linked issue and no blast radius. Ask what the bug was before adopting — a key-code collision or double-fire is annoying; a toggle that silently fails to revert is a usability trap. Test the toggle repeatedly in one session, not just once.@vite hashing. After deploying, run php artisan nova:publish (if applicable) and hard-refresh; a stale cached JS file is the most common "it works locally" report with this class of package.aria-label or a tooltip on each item, and the toggle itself needs a discernible name. Tab through the collapsed sidebar before shipping — it's a two-minute check that catches most of what a screen-reader user would hit.Nova config object in DevTools (the provider's Nova::provideToScript payload lands there), and watch Local Storage for the persistence key on toggle. If neither moves, the bundle isn't mounting — check the Nova version before anything else.boot() to see exactly what scripts/styles/config are injected. That's your map for both debugging and for writing a replacement if you ever need to fork — and at one maintainer and a 2018 release date, plan for the possibility that you own the fork.composer.json so a surprise 0.2.0 can't land mid-sprint.How can I help you explore Laravel packages today?