stepanenko3/nova-menu-collapsed
A lightweight Laravel Nova add-on that lets you collapse the left sidebar navigation, freeing up horizontal space for resource tables and forms. Toggle the menu out of the way to keep your admin panel clean and focused on content.
Prerequisites: a Laravel app already running a licensed Nova install (realistically Nova 4.x — see Gotchas) and Composer access to your Nova credentials.
Install:
composer require stepanenko3/nova-menu-collapsed
Laravel package auto-discovery registers the service provider, so there is no config/app.php edit. Then clear caches and hard-reload the browser, because you are changing a browser-rendered UI default, not just PHP:
php artisan optimize:clear
Where to look first: vendor/stepanenko3/nova-menu-collapsed/. The whole thing is a service provider plus one small JS/CSS asset. Read it in ten minutes — specifically:
boot(), to see whether it registers through Nova's public Nova::serving(function () { Nova::script(...); }) API or reaches into DOM/localStorage internals (this single answer determines how painful your next Nova upgrade is),composer.json, for the laravel/nova version constraint it was tested against,First use case: an admin panel with many resources where operators mostly live in one or two of them, or on laptop screens where the content column is cramped. Install on a disposable branch, load any resource index page, and confirm two things: the sidebar starts collapsed, and the native expand/collapse chevron still works and stays expanded after you navigate. If the second part fails, stop there — the package is overriding user intent rather than setting a default.
Gate it behind a config flag, don't ship it unconditional. Auto-discovery means the instant the package is in composer.json the behavior is on for every operator in every environment. Wrap the intent in your own config so it is reversible without a deploy:
// config/nova.php or a dedicated config/nova-menu.php
'collapsed_by_default' => env('NOVA_MENU_COLLAPSED', true),
If the package ships a publishable config, publish it (php artisan vendor:publish --provider=...) and drive it from there; otherwise gate at the point where you'd register it and set NOVA_MENU_COLLAPSED=false in .env for local/staging if you want the expanded view while developing.
Treat it as a reference implementation, not a dependency. This is the pattern the maintenance profile pushes you toward and it costs about an hour:
app/Providers/NovaServiceProvider.php inside the Nova::serving() callback.resources/js/nova/ and register it, or inline the few lines that set the default menu state.composer remove stepanenko3/nova-menu-collapsed.You keep the UX, own the code, and delete the "unmaintained dependency" finding from your next review. MIT license makes this clean. Do this before the pilot, not after.
Pin both sides in the same lockfile change. Never let the package float across a Nova upgrade:
"stepanenko3/nova-menu-collapsed": "1.2.2",
"laravel/nova": "4.x.*"
The changelog for v1.2.2 is literally "Fix for new Nova version" — proof that each Nova release can break this and needs a maintainer patch that may never come.
Pair it with the layout work it exists to support. The value only shows up if the content uses the reclaimed width: wide resource tables, long index columns, multi-column forms. If your dashboards are already centered and narrow, collapsing the menu buys you nothing — measure before standardizing.
Verify at the right granularity. A manual smoke test on one resource index and one detail/edit page in staging covers essentially the whole surface. Add a line to your Nova upgrade checklist — "confirm admin sidebar still defaults to collapsed" — because the realistic failure is a silent no-op that only surfaces as a user complaint weeks later.
Roll out as a pilot. Internal admin group first, behind the env flag, then decide whether it becomes your standard Nova preset across apps.
localStorage preference is what should govern subsequent loads. Confirm the two don't fight; a package that re-collapses on every navigation will annoy operators who expanded once.php artisan optimize:clear plus a hard reload. If the sidebar is still expanded, check the network tab for the registered asset before assuming the package is broken.Nova::script()/Nova::style() calls can interact; if the behavior is non-deterministic, your in-house copy removes the ordering question entirely because you control the callback.composer remove plus a cache clear.How can I help you explore Laravel packages today?