Weave 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

Nova Collapsible Sidebar Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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.

Implementation Patterns

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.

Gotchas and Tips

  • The Nova 4 problem is the whole ballgame. Vue 2 bundles don't mount in Nova 4. Before any upgrade of laravel/nova, check whether this package still earns its place; budget an afternoon to replace it with a custom toggle if it doesn't.
  • "Persisted" means 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.
  • Users who collapse and then can't find the nav labels. Icon-only strips are discoverable to power users and baffling to everyone else. Put the expand affordance (and the keyboard shortcut) in your team's Nova docs, and know the manual reset: DevTools → Application → Local Storage → delete the package's key.
  • Keyboard shortcut collisions are the exact bug 0.1.2 patched. The changelog names 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.
  • Asset caching after deploy. Compiled bundles served by Nova don't get your Mix/@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.
  • Accessibility in collapsed mode. Icon-only nav needs 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.
  • Debugging from the console. Confirm the package actually injected by inspecting the 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.
  • The extension point is the source, and it is small. Read the provider's 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.
  • Vendor-review before merge. Pre-1.0, single maintainer, no SLA, no security disclosure process. Fine for internal admin tooling; not something to put anywhere with compliance or revenue exposure. Pin the exact version in composer.json so a surprise 0.2.0 can't land mid-sprint.
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.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log