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 Menu Collapsed Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  • the provider's 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,
  • the JS asset, to see whether the default is applied once per session or re-applied on every navigation (it will fight the native toggle if it is the latter).

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.

Implementation Patterns

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:

  1. Copy the provider's asset registration into app/Providers/NovaServiceProvider.php inside the Nova::serving() callback.
  2. Copy the JS asset into resources/js/nova/ and register it, or inline the few lines that set the default menu state.
  3. 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.

Gotchas and Tips

  • The native toggle is the whole feature boundary. Expect a first-load default only. If you need per-user persistence, role-based defaults, or "remember my last state," this package does not do that — Nova's own 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.
  • Nova 5 is unverified. Last release May 2023. Spike against your exact Nova build in staging — not production, and not against the package's documented minimum. Nova ships compiled frontend assets, so "supported" is a moving target.
  • Auto-discovery has no per-user opt-out. It is global the moment it installs. Budget for one operator who hates it; your env/config flag is the only lever you get.
  • Browser cache hides the change. After install, 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.
  • Check registration order if you run other Nova extensions. Multiple 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.
  • Debugging a regression is one console check. Open devtools: a JS exception during menu bootstrap is the usual culprit after a Nova upgrade, and it may degrade more than the menu. Confirm no console errors as part of your upgrade check, not just the sidebar state.
  • Failure mode is cosmetic, and that's the point. The realistic worst case is "sidebar opens expanded again" for internal staff. No data, no secrets, no outbound calls, no data-model implications — which is exactly why a pilot is defensible even though the maintenance signal (12 stars, zero dependents, single maintainer, no release since 2023) is weak. Keep the exit cost in mind: composer remove plus a cache clear.
  • Don't expect a vendor. No SLA, no security response process, no issue triage. The mitigations are concrete: the source is short enough to audit in full, MIT lets you fork or vendor it, and the blast radius is confined to the admin chrome.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect