LaravelPackages.net
Acme Inc.
Toggle sidebar
ayarigab/pla

Write progressive Web Applications with laravel webframework.

7
0
About ayarigab/pla

ayarigab/pla is a Laravel package for write progressive web applications with laravel webframework.. It currently has 0 GitHub stars and 7 downloads on Packagist. Install it with composer require ayarigab/pla. Discover more Laravel packages by ayarigab or browse all Laravel packages to compare alternatives.

Last updated

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 ayarigab/pla

Add Provider

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

Ayarigab\Pla\PLAServiceProvider::class,

Add Facade

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

'PLA' => \Ayarigab\Pla\PLA::class,

Publish the Assets

Run the following command to publish config file,

php artisan pla:publish

Configure PLA

Add following code in root blade file in header section.

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

Add the following code in your root blade file before closing the body tag.

<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

PLA is (MIT) Licensed. Please read the License file to know more.

Comments