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

osama/nova-collapsible-sidebar

A Laravel Nova package that makes the Nova sidebar collapsible, letting users collapse and expand navigation to save screen space and focus on content. Simple integration for customizing the Nova admin sidebar.

View on GitHub
Deep Wiki
Context7

Getting Started

This is a tiny, single-purpose Nova package: it makes Nova's left-hand navigation sidebar collapsible and remembers that state. There is no admin UI, no database, no models — treat it as a small front-end enhancement, not a framework.

Install

composer require osama/nova-collapsible-sidebar

Because the package was last released in November 2022, assume it targeted Nova 4.x. Before anything else, confirm your Nova major version matches what the package was built against — a Nova 5 app is very likely to break it.

First things to check, in order

  1. composer show osama/nova-collapsible-sidebar — confirm it actually installed and see its declared nova constraint in composer.json.
  2. Read the package's service provider — it almost certainly only calls Nova::script(...) / Nova::style(...) or publishes a small JS/CSS asset. That tells you the entire surface area.
  3. Check whether assets are auto-published. If not:
    php artisan vendor:publish --provider="Osama\\NovaCollapsibleSidebar\\NovaCollapsibleSidebarServiceProvider"
    
    (Confirm the exact provider class in the repo — with a package this small, docs may be a one-liner.)
  4. Run php artisan nova:publish if the package ships a config file or views.
  5. Hard-refresh the Nova UI and look for a collapse toggle arrow/chevron near the sidebar header.

First use case

The value proposition is screen real estate on data-dense Nova screens — resource indexes with wide tables, custom tools, or dashboards on laptops. Log in, collapse the sidebar, reload the page, and verify the collapsed state persists (most implementations store it in localStorage). If it persists, the package is doing its one job.

Implementation Patterns

Zero-config global install. The intended pattern is: composer require, done. There's no per-app configuration in the typical flow, so it applies to every authenticated Nova user at once. That's the whole integration story — no middleware, no policies, no per-user toggles.

Theme and layout interplay. If you have a custom Nova theme or a layout override, load order matters. Nova applies Nova::script/Nova::style registrations from service providers; if your theme CSS also targets .sidebar or the content margin, one will win. The practical pattern is to let the package handle the toggle and keep your theme CSS off the sidebar wrapper element.

Coexistence with Nova's own responsive behavior. Nova already collapses the sidebar at narrow breakpoints. The package's value is manual collapse on wide screens. Test both: resize the window while collapsed, then expand — a common pattern is that the package's state and Nova's media-query state fight each other, leaving the sidebar in a half-collapsed visual state. If that happens, scope the package's CSS to desktop widths only.

Custom tools and dashboards. If you build Nova tools or custom dashboards, don't hardcode margin-left or grid widths that assume the sidebar width — use the CSS variable Nova exposes (or 100vw relative units) so your tool reflows when the sidebar collapses. This is the one integration tip that actually matters day-to-day: your custom cards should be fluid, not fixed-width.

Persisting behavior in CI/staging. Because there is no backend component, "configuration" is limited to whatever the package's published config file offers (usually a default collapsed state). If you need per-user preference storage, you'd have to build it yourself — send the state to a user.preferences column via a tiny fetch call and hydrate on load. At that point you're writing more code than the package saves, so only bother if this is a core UX requirement.

Gotchas and Tips

Nova version compatibility is the big risk. Last release 2022-11-29, one star, zero dependents. Nova 5's front-end was rebuilt; assets registered against Nova 4 may load but fail silently, or the toggle button may simply never render. Check browser devtools console for JS errors immediately after install. If you see Uncaught errors originating from a package asset, this is why.

Nova already ships a collapsible sidebar. Modern Nova includes a collapse control. Before adopting this, manually collapse the sidebar in a stock Nova install. If it works natively, this package is redundant — remove it and keep your dependency count down.

Asset publishing is the most common failure mode. A loaded service provider with unpublished assets means the CSS/JS 404s in public/vendor/.... Check the Network tab for 404s after a fresh deploy, and remember php artisan vendor:publish in your deploy script if the package doesn't auto-publish.

Cache clearing. After install or upgrade: php artisan optimize:clear (or at least view:clear and config:clear). Nova caches its asset manifest aggressively — a stale manifest is a classic "installed but nothing happened" cause.

Debugging the toggle. Open devtools, find the toggle element, and check whether a click handler is attached (Elements → Event Listeners). If the click does nothing and there's no listener, the JS never loaded — go back to assets, not config.

Persistence quirks. If the state is in localStorage, it's per-browser, per-domain. That means it won't follow a user across devices, won't apply to new team members, and gets wiped by hard resets or incognito. Set expectations with stakeholders before they file a bug.

Escape hatch / extension points. With a package this small, the realistic maintenance strategy is to fork it. Copy the JS asset into resources/js of your app, register it yourself via Nova::script() in your NovaServiceProvider::boot(), and drop the dependency. You get version control, Nova 5 fixes, and no abandoned-package risk for what is likely a few dozen lines of code.

Verdict for the assessment: low risk to try, but treat it as an experiment, not infrastructure. Pin it, verify it against your Nova version, and budget a morning to inline it if (when) it needs maintenance.

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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core