Download the PHP package crizprz/pwacrizprz without Composer
On this page you can find all versions of the php package crizprz/pwacrizprz. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download crizprz/pwacrizprz
More information about crizprz/pwacrizprz
Files in crizprz/pwacrizprz
Package pwacrizprz
Short Description this package will turn your website into a pwa
License MIT
Informations about the package pwacrizprz
Progressive Web Aplication (PWA) for Laravel by CRIZPRZ
This package for Laravel converts your project to a (PWA). When entering the site from a device it will ask to add to the home screen
Your application should work with navigation within the HTML. (no reliance on the browser back or forward button).
demo of the pwzcrizprz package
REQUIREMENTS
Composer v.2 is recommended
progressive web applications require working over the HTTPS protocol, unless you are working with localhost, if your site does not have an SSL certificate visit Let's Encrypt
INSTALLATION
Install the package through Composer.
Or add the following to your composer.json
file :
CONFIGURATION
-
Open
config/app.php
and add this line to your Service Providers Array. -
publish the assets.
- clear the views.
HOW TO USE
- Manifest
- Blade Directive
- Meta Tags
- Possible mistakes
- Service Worker
- Contributing
- License
manifest
configure manifest.json file located in public_path/manifest.json
Key manifest properties
"short_name": "My PWA",
You must provide at least the short_name
or name
property.
"start_url": "/"
The start_url
is required and tells the browser where your application should start when it is launched.
"background_color": "#5DCCE2"
The background_color
property is used on the splash screen when the application is first launched on mobile.
"display": "standalone"
You can customize what browser UI is shown when your app is launched. Example: fullscreen
, standalone
, minimal-ui
, for more details visit manifest.json.
"theme_color": "#5DCCE2"
The theme_color
sets the color of the tool bar, and may be reflected in the app's preview in task switchers. The theme_color should match the meta theme color specified in your document head.
This meta has already been included in the file resources/views/PWA/metatags.blade.php
.
"icons": "[{}]"
When a user installs your PWA, you can define a set of icons for the browser to use on the home screen, app launcher, task switcher, splash screen, and so on.
"shortcuts": "[{}]"
The shortcuts
property is an array of app shortcut objects whose goal is to provide quick access to key tasks within your app. Each member is a dictionary that contains at least a name and a url
directive
Include within your
the blade directive @PWACRIZPRZmeta
The meta tags must be included for the correct deployment to an android and IOS device.
You find this in the file resources/views/PWA/metatags.blade.php
.
in this file the service worker is registered, the meta theme-color is configured and the splash screens for IOS devices are included.
mistakes
-
Check syntax of
public_path/manifest.json
. -
when the
manifest.json
file is edited run the artisan commandphp artisan view:clear
. -
Check syntax of
sw.js
. - check icon names and splash screen match
public_path/manifest.json
,public_path/sw.js
, andresources/views/PWA/metatags.blade.php
files .
ServiceWorker
you can customize the service worker in the file public_path/sw.js
By default, the service worker implemented by this app is:
Note that if files are added to the cache when registering the new service worker removes the old cache and creates the new one
Contributing
To contribute fork the repository, make your changes then send a pull request on GitHub, then send CRIZPRZ an email.
License
The Laravel CRIZPRZ\PWACRIZPRZ open-sourced software licensed under the MIT license