mrshanebarron/drawer
Drawer is a Laravel/PHP package that simplifies adding slide-out drawer panels to your application. Use it to create off-canvas navigation, filters, or settings with minimal setup, keeping your UI clean and your implementation lightweight. It is intended for Laravel projects that want a simple, reus...
composer require mrshanebarron/drawer and confirm auto-discovery — check php artisan about or bootstrap/cache/packages.php. If the provider is not listed there, nothing else will work.php artisan vendor:publish --provider="MrShaneBarron\Drawer\DrawerServiceProvider" (or --tag=sb-config if a tag is registered). Since v1.0.1 the published file uses the sb- prefix — expect config/sb-drawer.php, not config/drawer.php.config('sb-drawer.*')), the default position/size/overlay settings, and the component class names the package exposes. The README may still reference a pre-1.0.1 filename.resources/views/vendor/drawer/ or the package's resources/views/components/). This is the package's entire API surface — there is no service class to resolve or driver to configure, so reading the component is reading the documentation.layouts/app.blade.php, or a filter panel on an index page.data- attribute or a dedicated component) that targets a drawer by id. Give every drawer on a page a unique id and keep the trigger next to it in the same partial so they move together. Orphaned IDs are the #1 source of "the drawer doesn't open."resources/views/components/drawers/cart.blade.php (or partials/drawers/cart.blade.php) that takes only the slots it needs. Include it in the layout for persistent drawers (nav, cart) and in a specific view for page-local ones (filters, row details).right/left), size, and overlay behavior in config/sb-drawer.php as the app-wide default. Override per drawer via props on the component (<x-drawer position="left" size="lg" …>). Never edit the component source to change a default — you'll lose it on the next vendor:publish --force.$dispatch('open-drawer', { id: 'cart' }) and a listener inside a small wrapper). Don't fork the package component — put the wrapper in your app and let the package handle markup.$this->blade('<x-drawer id="cart" position="left"><x-slot:header>Cart</x-slot:header>Body</x-drawer>') and assert assertSee('cart', false), the position class, and that the slot contents render. Add one smoke test per drawer in your layout so a broken publish is caught in CI rather than in staging.id) from your own CSS layer rather than editing the published Blade. If the package ships Tailwind classes, ensure your content config scans the published view path (./resources/views/vendor/drawer/**/*.blade.php) or those classes will be purged.php artisan view:clear && php artisan config:clear in the deploy pipeline; a cached config built before the sb- file was published will silently fall back to package defaults.git mv your customized config to config/sb-drawer.php rather than re-publishing — vendor:publish will not overwrite, so you'll end up with both files and only one of them being read. Then php artisan config:clear.sb-drawer.php; keys are read as config('sb-drawer.position'). A typo in either half returns null with no error and the component silently uses its built-in default. Assert your config values in tinker (config('sb-drawer')) early rather than debugging styling later.vendor:publish never overwrites. After every upgrade, run ls resources/views/vendor | grep drawer and ls config | grep sb-. A re-publish leaves your old customized file in place and the new one absent — so a component fix ships to the package but never reaches your app.id without updating the trigger (or vice versa) is silent: the page renders, the button just does nothing. Grep for the ID on both sides when you rename one.body class or overflow style when open. Nesting a drawer inside another (or opening a modal from a drawer) can leave scroll locked after close. Test close-by-overlay-click, close-by-Esc, and close-by-button separately, and check document.body classes after each.--z-drawer: 40, overlay 39) and make everything else respect it.md:hidden) rather than showing both."mrshanebarron/drawer": "^1.0") and diff the published config/view stub after each release. A patch-level rename like v1.0.1 is a consumer-visible change that automated dependency tooling won't flag.<x-drawer> renders anything at all), (3) does the published config override the packaged default, (4) do the trigger and drawer IDs match. Almost every "nothing happens" report is step 1 or 4.How can I help you explore Laravel packages today?