Download the PHP package saakiiib/laravel-spa without Composer
On this page you can find all versions of the php package saakiiib/laravel-spa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download saakiiib/laravel-spa
More information about saakiiib/laravel-spa
Files in saakiiib/laravel-spa
Package laravel-spa
Short Description Zero-reload SPA engine for Laravel Blade — no jQuery, no Livewire, no Inertia.
License MIT
Informations about the package laravel-spa
Laravel SPA — by Sakib
By default, every link click in Laravel loads a full new page — HTML, CSS, JS, fonts, everything re-downloads. SPA navigation skips that. Only the content changes, the rest stays. Faster, smoother, no white flash between pages.
Most Laravel SPA solutions force you to either abandon Blade entirely (Inertia) or add jQuery (pjax). This package adds that same speed on top of your existing Blade views — no rewrite, nothing changes except how fast it feels.
Quick Start
Add
/public/vendorto your.gitignoreto avoid committing published assets.Updating? When you run
composer update, the publishedspa-engine.jsinpublic/vendor/does not auto-update — Composer only updates the package source, not previously published assets. Re-publish with the--forceflag to pull the latest fix/version in:Skipping this means you'll keep running an old
spa-engine.jseven after upgrading the package version.
Setup — @extends / @section
1. Layout file
Add @spaContent to your content wrapper and @spaEngine before </body>. Make sure @yield('script') comes after @spaEngine.
2. Navigation links
Add @spa to links you want SPA navigation on. Links without @spa do a normal full reload.
3. Controller
4. Page views — no changes needed
Setup — x-layout components
1. Layout component
Add @spaContent to your content wrapper and @spaEngine before </body>.
2. Navigation links — same as above, add @spa:
3. Controller — same as above:
4. Page views
What works out of the box
- URL updates, back/forward button, refresh, direct links — all work
- Per-page styles and scripts load and unload on every navigation
- Session expiry redirects cleanly instead of breaking
- Hover prefetch — pages start loading before you even click
- Works with both
@extendsandx-layout
Requirements
- PHP 8.1+
- Laravel 10, 11, 12, or 13
Contributing
Found a bug or want to improve something? PRs are welcome on GitHub.
License
MIT — Sakib