PHP code example of partimate / cdnmate

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

    

partimate / cdnmate example snippets


[
    'uploader_url' => env('CDN_MATE_UPLOADER_URL', 'https://cdnmate.io'),
    'cdn_url' => env('CDN_MATE_URL', 'http://127.0.0.3/media/'),
    'fallback' => env('CDN_MATE_FALLBACK', true),
    'image_path' => env('IMAGE_MATE_PATH', 'uploads/'),
];

use CDNMate;

$imageUrl = CDNMate::upload($request->file('image'), 90);

$imageUrl = CDNMate::upload($request->file('image'), 90);

CDN_MATE_FALLBACK=true

return [
    'cdn_url' => env('CDN_URL', 'https://cdn.yourdomain.com/'),
    'fallback' => env('CDNMATE_FALLBACK', true),
    'image_quality' => 90,
    'cache_ttl' => 10,
];
bash
php artisan vendor:publish --tag=cdnmate
bash
php artisan vendor:publish --tag=cdnmate