PWA

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:Blade

v1.1.8 2025-04-09 20:47 UTC

This package is auto-updated.

Last update: 2025-05-16 00:48:31 UTC


README

Installation

composer require 976-tuna/pwa
php artisan vendor:publish

Integration

to add a install button to your site, add this

@include('pwa::components.pwa-install-button')

Add the following to your layout file:

In the <head> section:

<link rel="manifest" href="{{ url('/manifest.json') }}">

In the <body> section:

<script>
    if ('serviceWorker' in navigator) {
        window.addEventListener('load', function() {
            navigator.serviceWorker.register('/serviceworker.js')
                .then(function(registration) {
                    //console.log('Service Worker registered with scope:', registration.scope);
                })
                .catch(function(error) {
                    //console.log('Service Worker registration failed:', error);
                });
        });
    }
</script>

where ever you would like the button to show add this

@include('pwa::components.pwa-install-button')