Skip to content

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 ​

PartWhat it doesPage
Manifest/manifest.webmanifest from config and a fluent API, display mode, icons, OS integrationManifest, Display modes
Components<x-pwa::head/>, <x-pwa::nav/>, <x-pwa::install/>Components
Service worker/sw.js built from the Vite build, cache strategies, updatesService worker
Offlineoffline screen, pages available offline, offline queueOffline
Sessionremember-me in the installed app, keep-alive, CSRF refreshPersistent login
Maintenancemaintenance screen, pwa:down, telling a 503 apart from a network failureMaintenance mode
Kill switchpwa:disable removes the service worker from every deviceKill switch
Clientwindow.Pwa, pwa:* eventsJavaScript client
Pushoptional: notification channel, Pwa.push, per-device subscriptions; or a slot for your own push systemPush notifications
AIMCP server, skill and reference for coding agentsAI 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.cache middleware.

Quick start ​

bash
composer require nyoncode/laravel-pwa
php artisan pwa:install
php artisan pwa:icons resources/pwa/icon.png
blade
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
    <x-pwa::head/>
</head>

Continue with Installation.

Released under the MIT License.