976-tuna / pwa
PWA
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: ^8.1
- laravel/framework: ^12.0
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')