PHPackages                             ladumor/laravel-pwa - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ladumor/laravel-pwa

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ladumor/laravel-pwa
===================

this package used for the make pwa website.

v1.0.1(4mo ago)273323.3k—5%48MITPHPPHP &gt;=5.6

Since Sep 29Pushed 4mo ago6 watchersCompare

[ Source](https://github.com/shailesh-ladumor/laravel-pwa)[ Packagist](https://packagist.org/packages/ladumor/laravel-pwa)[ Fund](https://www.buymeacoffee.com/ladumor)[ RSS](/packages/ladumor-laravel-pwa/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (7)Dependencies (1)Versions (10)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/a28a50bd3422723eca14ca5277e65e8b08e6426b368869ab2a3a903e5fe3a750/68747470733a2f2f706f7365722e707567782e6f72672f6c6164756d6f722f6c61726176656c2d7077612f76)](https://packagist.org/packages/ladumor/laravel-pwa)[![Daily Downloads](https://camo.githubusercontent.com/1b5ad572899df2212b8cd83c0ab1861a50f5a805f005b2e0379efe3f57e93530/68747470733a2f2f706f7365722e707567782e6f72672f6c6164756d6f722f6c61726176656c2d7077612f642f6461696c79)](https://packagist.org/packages/ladumor/laravel-pwa)[![Monthly Downloads](https://camo.githubusercontent.com/e1f415eee5986990457a8890994a4839b95ab1079a892c99dc36a462286efbac/68747470733a2f2f706f7365722e707567782e6f72672f6c6164756d6f722f6c61726176656c2d7077612f642f6d6f6e74686c79)](https://packagist.org/packages/ladumor/laravel-pwa)[![Total Downloads](https://camo.githubusercontent.com/c96689d15854d49cb6e21e7cdb73557b64880f36f18e16dcb999355a113696d2/68747470733a2f2f706f7365722e707567782e6f72672f6c6164756d6f722f6c61726176656c2d7077612f646f776e6c6f616473)](https://packagist.org/packages/ladumor/laravel-pwa)[![License](https://camo.githubusercontent.com/f5b5f5ad35dc8f75c6ae5fbf3c241271061911df90f5ecc1d09fccc625a034ac/68747470733a2f2f706f7365722e707567782e6f72672f6c6164756d6f722f6c61726176656c2d7077612f6c6963656e7365)](https://packagist.org/packages/ladumor/laravel-pwa)[![PHP Version Require](https://camo.githubusercontent.com/4765cc6f1b30b55965a586714153cc572c35529c0c57e9737708eaedcc699a41/68747470733a2f2f706f7365722e707567782e6f72672f6c6164756d6f722f6c61726176656c2d7077612f726571756972652f706870)](https://packagist.org/packages/ladumor/laravel-pwa)

[![Buy Me A Coffee](https://camo.githubusercontent.com/af7c4175cb725540f9b150c8450be14b719748cbe0445c56e51c70bb51fad263/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d7265642e706e67)](https://www.buymeacoffee.com/ladumor)

Laravel PWA
===========

[](#laravel-pwa)

You can follow this video tutorial as well for installation.
------------------------------------------------------------

[](#you-can-follow-this-video-tutorial-as-well-for-installation)

[![](https://camo.githubusercontent.com/0524cb9500f88ffc48396ea0acce518de5175c3c4597b47d8e3429fec909759a/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f39482d5438314b5150796f2f302e6a7067)](https://youtu.be/9H-T81KQPyo)

Watch Other Lavavel tutorial here
---------------------------------

[](#watch-other-lavavel-tutorial-here)

[![](https://camo.githubusercontent.com/78b94b1a27e59e40a309e49b70ed1d231ba18bdf25f4f93b7d57173cac6039b7/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f794d7473674273714451732f302e6a7067)](https://www.youtube.com/channel/UCuCjzuwBqMqFdh0EU-UwQ-w?sub_confirmation=1))

Installation
------------

[](#installation)

Install the package by the following command, (try without `--dev` if you want to install it on production environment)

```
composer require --dev ladumor/laravel-pwa

```

Add Provider
------------

[](#add-provider)

Add the provider to your `config/app.php` into `provider` section if using lower version of laravel,

```
Ladumor\LaravelPwa\PWAServiceProvider::class,

```

Add Facade
----------

[](#add-facade)

Add the Facade to your `config/app.php` into `aliases` section,

```
'LaravelPwa' => \Ladumor\LaravelPwa\LaravelPwa::class,

```

Publish the Assets
------------------

[](#publish-the-assets)

Run the following command to publish config file,

```
php artisan laravel-pwa:publish

```

Configure PWA
-------------

[](#configure-pwa)

Add following code in root blade file in header section.

```

@pwaHead

```

You can also pass custom logo and theme color as arguments:

```
@pwaHead('custom-logo.png', '#ff0000')

```

Add following code in root blade file in before close the body.

```
@laravelPwa
@pwaUpdateNotifier
@pwaInstallButton

```

Background Sync
---------------

[](#background-sync)

This package supports Background Sync, allowing users to queue actions while offline and automatically synchronize them when the connection is restored.

### Automatic Form Sync

[](#automatic-form-sync)

When a user submits a POST form while offline:

1. The submission is intercepted.
2. The data is saved locally in IndexedDB.
3. A background sync event is registered.
4. As soon as the browser detects the connection is restored, the Service Worker automatically retries the queued submissions.

### Manual Request Queuing

[](#manual-request-queuing)

Developers can also manually queue requests using the global `window.laravelPwaSync` helper:

```
const request = new Request('/api/data', {
    method: 'POST',
    body: JSON.stringify({ key: 'value' }),
    headers: {
        'Content-Type': 'application/json'
    }
});

if (window.laravelPwaSync) {
    await window.laravelPwaSync.queue(request);
}
```

### Browser Support

[](#browser-support)

Background Sync relies on the `Service Worker` and `SyncManager` API. If the browser does not support these features, the application will continue to work as a standard web application without background synchronization.

Smart Install Prompt Manager
----------------------------

[](#smart-install-prompt-manager)

This package provides helpers to manage the PWA installation experience effectively.

### Detecting Installability

[](#detecting-installability)

You can check if the app is ready to be installed using `window.laravelPwaInstall.canInstall()`.

```
if (window.laravelPwaInstall.canInstall()) {
    console.log('App is ready for installation');
}
```

### Deferring and Triggering Prompts

[](#deferring-and-triggering-prompts)

The package automatically intercepts the `beforeinstallprompt` event and defers it. You can trigger the prompt manually at a better time (e.g., after a user interaction).

```
async function myCustomInstallFlow() {
    const outcome = await window.laravelPwaInstall.showPrompt();
    if (outcome === 'accepted') {
        console.log('User accepted the install prompt');
    }
}
```

### Tracking Install Events

[](#tracking-install-events)

You can listen for custom events to track the installation process:

```
window.addEventListener('pwa-installable', (e) => {
    console.log('PWA is ready to be installed');
});

window.addEventListener('pwa-installed', () => {
    console.log('PWA was successfully installed');
});
```

### Checking Standalone Mode

[](#checking-standalone-mode)

Check if the app is currently running in standalone mode (installed):

```
if (window.laravelPwaInstall.isStandalone()) {
    console.log('App is running in standalone mode');
}
```

Splash Screen &amp; Icon Generator
----------------------------------

[](#splash-screen--icon-generator)

This package includes a tool to automatically generate all required PWA icons and splash screen assets from a single source image.

### How to use:

[](#how-to-use)

1. Place your high-resolution source image (recommended 512x512 or larger) in the `public` directory of your Laravel application.
2. Name the file `pwa-source.png`.
3. Run the publish command: ```
    php artisan laravel-pwa:publish
    ```
4. The package will automatically generate icons of various sizes (72x72 to 512x512) and update your `manifest.json`.

If `pwa-source.png` is not found, the package will use a default logo to generate the assets.

### Smart Versioning &amp; Cache Busting

[](#smart-versioning--cache-busting)

This package includes a smart versioning system to ensure that your users always have the latest version of your PWA and its assets.

#### How it works:

[](#how-it-works)

1. **Service Worker Versioning**: Every time you run `php artisan laravel-pwa:publish`, a new unique version ID is generated and embedded in your `sw.js`. This triggers an update in the user's browser.
2. **Manifest &amp; Icon Cache Busting**: The `manifest.json` and all listed icons include version query parameters, ensuring that browsers and devices refresh them when you re-publish.
3. **Blade Directive versioning**: The `@laravelPwa` directive automatically appends a version timestamp to the `sw.js`, `pwa-install.js`, and `background-sync.js` script registrations. This forces the browser to check for a new Service Worker file immediately.
4. **Automatic Update Notification**: When a new version is detected, the `@pwaUpdateNotifier` directive (if included) will automatically handle the `skipWaiting` and reload the page to activate the new Service Worker, ensuring a seamless update experience for users.

To update your PWA version and bust all caches, simply run:

```
php artisan laravel-pwa:publish
```

Built-in Manifest Generator
---------------------------

[](#built-in-manifest-generator)

Instead of manually editing the `manifest.json` file, you can use the interactive manifest generator to configure your PWA settings:

```
php artisan pwa:manifest
```

This command will prompt you for:

- App Name
- Short Name
- Description
- Start URL
- Theme &amp; Background Colors
- Display Mode (fullscreen, standalone, etc.)
- Orientation

After running this command, remember to run `php artisan laravel-pwa:publish` to apply the changes to your public directory.

Debug &amp; Dev Tools
---------------------

[](#debug--dev-tools)

This package includes a set of developer-friendly tools to help you debug your PWA implementation.

### Artisan Command

[](#artisan-command)

Run the following command to see debugging tips:

```
php artisan pwa:debug
```

### On-Screen Debug Helper

[](#on-screen-debug-helper)

Add the `@pwaDebug` directive to your blade file (ideally only in development). It will only load if `APP_DEBUG=true` in your `.env`.

```
@pwaDebug
```

This directive injects a global `window.laravelPwaDebug` object into your browser console with the following utilities:

MethodDescription`laravelPwaDebug.viewCaches()`List all PWA caches and their current contents.`laravelPwaDebug.clearCaches()`Clear all PWA-related caches.`laravelPwaDebug.forceUpdate()`Force a Service Worker update check.`laravelPwaDebug.unregister()`Unregister all Service Workers for the domain.`laravelPwaDebug.help()`Show available debug commands.### Service Worker Logging

[](#service-worker-logging)

The Service Worker now includes basic lifecycle logging (Installing, Activated) to help you track its state in the browser console.

### License

[](#license)

The MIT License (MIT). Please see [License](LICENSE.md) File for more information

Note
----

[](#note)

PWA only works with https. so, you need to run either with `php artisan serve` or create a virtual host with https. you can watch the video for how to create a virtual host with HTTPS

[![](https://camo.githubusercontent.com/1c8cd4347b473ddb1c53b2c6d62ec7f105f52cb83df5177a126c248990b9dd56/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f44354971446348795853512f302e6a7067)](https://youtu.be/D5IqDcHyXSQ)

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance76

Regular maintenance activity

Popularity55

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~268 days

Recently: every ~350 days

Total

7

Last Release

133d ago

Major Versions

v0.0.5 → v1.0.02026-02-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/e474b86de974345ff98de6151b9b98235df335b075cb709a78e6f133bddaaa96?d=identicon)[ladumor](/maintainers/ladumor)

---

Top Contributors

[![shailesh-ladumor](https://avatars.githubusercontent.com/u/16555999?v=4)](https://github.com/shailesh-ladumor "shailesh-ladumor (42 commits)")[![vahidalvandi](https://avatars.githubusercontent.com/u/7871623?v=4)](https://github.com/vahidalvandi "vahidalvandi (2 commits)")[![da-sie](https://avatars.githubusercontent.com/u/459266?v=4)](https://github.com/da-sie "da-sie (1 commits)")[![tanthammar](https://avatars.githubusercontent.com/u/21239634?v=4)](https://github.com/tanthammar "tanthammar (1 commits)")

---

Tags

laravellaravel-pwaphplaravellaravel pwapwa-laravel

### Embed Badge

![Health badge](/badges/ladumor-laravel-pwa/health.svg)

```
[![Health](https://phpackages.com/badges/ladumor-laravel-pwa/health.svg)](https://phpackages.com/packages/ladumor-laravel-pwa)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[erag/laravel-pwa

A simple and easy-to-use PWA (Progressive Web App) package for Laravel applications.

180124.1k](/packages/erag-laravel-pwa)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
