PHP code example of eliurkis / laravelcdn

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

    

eliurkis / laravelcdn example snippets


'providers' => array(
     //...
     Eliurkis\laravelcdn\CdnServiceProvider::class,
),

'aliases' => array(
     //...
     'CDN' => Eliurkis\laravelcdn\Facades\CdnFacadeAccessor::class
),

'url' => env('CDN_URL', 'https://s3.amazonaws.com'),

'bypass' => env('CDN_BYPASS', false),

'cloudfront'    => [
    'use' => env('CDN_USE_CLOUD_FRONT', false),
    'cdn_url' => env('CDN_CLOUD_FRONT_URL', false)
],

'default' => 'AwsS3',

'aws' => [

    's3' => [

        'version'   => 'latest',
        'region'    => '',
        'endpoint'  => '', // For DO Spaces

        'buckets' => [
            'my-backup-bucket' => '*',
        ]
    ]
],

'buckets' => [

    'my-default-bucket' => '*',

    // 'js-bucket' => ['public/js'],
    // 'css-bucket' => ['public/css'],
    // ...
]


'    'directories'   => ['public/dist'],
    'extensions'    => ['.js', '.css', '.yxz'],
    'patterns'      => ['**/*.coffee'],
],

'exclude'    => [
    'directories'   => ['public/uploads'],
    'files'         => [''],
    'extensions'    => ['.TODO', '.txt'],
    'patterns'      => ['src/*', '.idea/*'],
    'hidden'        => true, // ignore hidden files
],

'acl'           => 'public-read',
'metadata'      => [ ],
'expires'       => gmdate("D, d M Y H:i:s T", strtotime("+5 years")),
'cache-control' => 'max-age=2628000',
bash
php artisan vendor:publish --provider 'Eliurkis\laravelcdn\CdnServiceProvider'
bash
php artisan cdn:push
bash
php artisan cdn:empty