PHP code example of thoughtco / statamic-cloudflare-images

1. Go to this page and download the library: Download thoughtco/statamic-cloudflare-images 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/ */

    

thoughtco / statamic-cloudflare-images example snippets


   'r2' => [
       'driver' => 's3',
       'key' => env('R2_ACCESS_KEY_ID'),
       'secret' => env('R2_SECRET_ACCESS_KEY'),
       'region' => 'auto',
       'bucket' => env('R2_BUCKET'),
       'endpoint' => env('R2_ENDPOINT'), // https://<account_id>.r2.cloudflarestorage.com
       'use_path_style_endpoint' => true,
   ],
   
bash
composer vendor:publish --tag=cfimage-config  #this publishes config/cfimage.php
php artisan vendor:publish --tag=cfimage-worker  #this publishes workers/cfimage/

   npx wrangler secret put CFIMAGE_SIGNING_KEY
   

   php artisan cfimage:publish --deploy
   

php artisan cfimage:publish            # regenerate only
php artisan cfimage:publish --deploy   # regenerate + wrangler deploy