Skip to content

This package used for the make pwa website quickly.

License

Notifications You must be signed in to change notification settings

DD4You/laravel-pwa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Daily Downloads Monthly Downloads Total Downloads License PHP Version Require

Laravel PWA

Installation

Install the package by the following command,

 composer require dd4you/pwa

Publish the Assets

Run the following command to publish config file,

php artisan dd4you:install-pwa

Configure PWA

Add following code in root blade file in header section.

<!-- PWA  -->
<meta name="theme-color" content="#6777ef"/>
<link rel="apple-touch-icon" href="{{ asset('logo.PNG') }}">
<link rel="manifest" href="{{ asset('/manifest.json') }}">

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

<script src="{{ asset('/sw.js') }}"></script>
<script>
    if (!navigator.serviceWorker.controller) {
        navigator.serviceWorker.register("/sw.js").then(function (reg) {
            console.log("Service worker has been registered for scope: " + reg.scope);
        });
    }
</script>

License

The MIT License (MIT). Please see License File for more information

About

This package used for the make pwa website quickly.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages