PHP code example of manhamprod / pwa-assets-generator

1. Go to this page and download the library: Download manhamprod/pwa-assets-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

manhamprod / pwa-assets-generator example snippets


    'providers' => [
        // Other providers...
        Manhamprod\PwaAssetsGenerator\PwaAssetsGeneratorServiceProvider::class,
    ],
    

    'aliases' => [
        // Other aliases...
        'PwaAssetsGenerator' => Manhamprod\PwaAssetsGenerator\PwaAssetsGeneratorFacade::class,
    ],
    

use Manhamprod\PwaAssetsGenerator\PwaAssetsGenerator;

$icons = PwaAssetsGenerator::generateAppIcon('path/to/image.png');

$splashScreens = PwaAssetsGenerator::generateSplashScreen('path/to/image.png', 'My PWA');

PwaAssetsGenerator::generateManifest([
    'name' => 'My PWA',
    'short_name' => 'MyPWA',
    'start_url' => '/',
    'lang' => 'en',
    'description' => 'A Progressive Web App',
    'display' => 'standalone',
    'background_color' => '#ffffff',
    'icons' => [
        ['path' => 'icons/192x192.png', 'size' => '192x192'],
        ['path' => 'icons/512x512.png', 'size' => '512x512'],
    ]
]);

PwaAssetsGenerator::generateFavicon('AB');

PwaAssetsGenerator::generateAssets('path/to/image.png', 'AB', 'My PWA');

{!! PwaAssetsGenerator::
bash
    php artisan vendor:publish --provider="Manhamprod\PwaAssetsGenerator\PwaAssetsGeneratorServiceProvider" --tag=config