PHP code example of zanozik / cdnjs

1. Go to this page and download the library: Download zanozik/cdnjs 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/ */

    

zanozik / cdnjs example snippets


// config/app.php
'providers' => [
    ...
    Zanozik\Cdnjs\CdnjsServiceProvider::class,
],

php artisan package:install



namespace App\Listeners;

class NewVersionListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  \Zanozik\Cdnjs\Events\NewAssetVersion $event
     * @return void
     */
    public function handle(\Zanozik\Cdnjs\Events\NewAssetVersion $event)
    {
        //$event->asset will return your affected asset
    }
}


//app/Providers/EventServiceProvider.php
    protected $listen = [
        'Zanozik\Cdnjs\Events\NewAssetVersion' => [
            'App\Listeners\NewVersionListener',
        ],
    ];


php artisan cache:clear
php artisan view:clear