Laravel PWA
nyoncode/laravel-pwa turns your Laravel application into an installable Progressive Web App: one app at one address. On desktop it runs in its own window with Back and Reload buttons, on phones and tablets it runs full screen. It works without a connection, survives maintenance mode, and the installed app stays signed in.
It supports Laravel 12 and 13 and PHP 8.2+. It is built on nyoncode/laravel-package-toolkit.
What it is made of
| Part | What it does | Page |
|---|---|---|
| Manifest | /manifest.webmanifest from config and a fluent API, display mode, icons, OS integration | Manifest, Display modes |
| Components | <x-pwa::head/>, <x-pwa::nav/>, <x-pwa::install/> | Components |
| Service worker | /sw.js built from the Vite build, cache strategies, updates | Service worker |
| Offline | offline screen, pages available offline, offline queue | Offline |
| Session | remember-me in the installed app, keep-alive, CSRF refresh | Persistent login |
| Maintenance | maintenance screen, pwa:down, telling a 503 apart from a network failure | Maintenance mode |
| Kill switch | pwa:disable removes the service worker from every device | Kill switch |
| Client | window.Pwa, pwa:* events | JavaScript client |
| Push | optional: notification channel, Pwa.push, per-device subscriptions; or a slot for your own push system | Push notifications |
| AI | MCP server, skill and reference for coding agents | AI agents |
What it does not do
- It does not push on its own. The push module stays off until you enable it, and the browser asks for permission only when your code calls
Pwa.push.subscribe(). See Push notifications. - It does not build your frontend. It takes assets from your app's Vite build (
public/build/manifest.json). - It does not decide what is available offline. No page is cached until the server allows it with the
pwa.cachemiddleware.
Quick start
bash
composer require nyoncode/laravel-pwa
php artisan pwa:install
php artisan pwa:icons resources/pwa/icon.pngblade
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<x-pwa::head/>
</head>Continue with Installation.