sarfraznawaz2005/loading
A lightweight Laravel package for adding loading indicators to your app. Easily show spinners or overlays during form submissions, AJAX requests, and page transitions using simple Blade directives and minimal configuration, with support for buttons, links, and custom elements. Keep users informed wh...
composer require sarfraznawaz2005/loadingSarfraznawaz2005\Loading\LoadingServiceProvider; no manual provider registration needed on Laravel 9/10.php artisan vendor:publish --tag=loading (verify the tag in the service provider if it differs), then review config/loading.php for enable/disable, spinner style, and overlay behaviour.</body> in your main layout (e.g. @loading), which injects the overlay markup and the JS that shows it on navigation/submit.Where to look first: config/loading.php, then the service provider (to see which directive/Blade component is registered), then the published views/assets if you need to restyle.
layouts/app.blade.php once so it covers every page using that layout, rather than per-view — this is the intended day-to-day usage.wire:loading for Livewire and Inertia router events for Inertia, and keep @loading off those pages — otherwise you get a stuck overlay after an intercepted submit.public/vendor/, so npm run build and redeploys don't clobber your changes.->waitUntilMissing('.loading-overlay'), class per your published markup).composer.json constraints before upgrading the framework — you may need to pin or fork.<body>. Placed in <head>, the overlay element won't exist when the JS initialises and nothing appears to work.php artisan view:clear and php artisan config:clear. Stale compiled views are the most common cause of "I changed it and nothing happened".DOMContentLoaded/pageshow events as a safety net, including bfcache restores.public/vendor/loading and need a real deploy step. Pipelines that ignore public/ during build will ship a page with an invisible-but-blocking overlay.role="status" plus aria-live="polite" (and a text label) to the overlay element.config('loading.enabled') (or your own env check) so the overlay doesn't interfere with automated browser tests.How can I help you explore Laravel packages today?