laravel-spa maintained by anascloud
Laravel SPA
Turn your Laravel Blade app into a single page app. Zero configuration.
A lightweight, zero-configuration SPA navigation engine for Laravel that transforms traditional server-rendered applications into seamless Single Page Applications. Enjoy fast, app-like navigation without React, Vue, Angular, or any frontend framework. Keep your existing Laravel Blade views, routes, controllers, and development workflow—just install and experience SPA-like performance with minimal effort.
Installation
- composer require anascloud/laravel-spa
- php artisan vendor:publish --tag=spa-assets
That's it: no config, no layout changes. Requires PHP 8.1+ and Laravel 10, 11 or 12.
Usage
It works automatically. To run code on every page, use spa:load instead of DOMContentLoaded:
document.addEventListener('spa:load', () => { /* runs on first load and after every navigation */ });
Skip a link or form with data-no-spa, navigate from JS with Spa.visit('/url').