foodticket/laravel-filesystem-cloudflare-images

A Laravel filesystem driver for Cloudflare Images
11,637 6
Install
composer require foodticket/laravel-filesystem-cloudflare-images
Latest Version:v0.1.0
PHP:^8.3
License:MIT
Last Updated:Sep 7, 2026
Links: GitHub  ·  Packagist
Maintainer: rikmorskate

Cloudflare Images Filesystem Driver

This package provides a filesystem driver for Cloudflare Images. If you need more control or want to want to implement more Cloudflare API endpoints have a look at our Laravel wrapper for Cloudflare which is also used by this packages.

The full documentation of the Cloudflare Images API can be found here.

Requirements

  • PHP >= 8.3
  • Laravel >= 12.0

Installation

To start using the package, you need to install it via Composer:

composer require foodticket/laravel-filesystem-cloudflare-images

Confuguration

Add the following to your config/filesystems.php file:

'cloudflare-images' => [
    'driver' => 'cloudflare-images',
    'account_id' => env('CLOUDFLARE_IMAGES_ACCOUNT_ID'),
    'api_email' => env('CLOUDFLARE_IMAGES_API_EMAIL', env('CLOUDFLARE_API_EMAIL')),
    'api_key' => env('CLOUDFLARE_IMAGES_API_KEY', env('CLOUDFLARE_API_KEY')),
],

Add the following environment variables to your .env file:

CLOUDFLARE_IMAGES_ACCOUNT_ID=<account id>

If you did not have our Laravel-Cloudflare wrapper yet you also need to add the following environment variables to your .env file:

CLOUDFLARE_IMAGES_API_EMAIL=<API email>
CLOUDFLARE_IMAGES_API_KEY=<API key>

Getting started

The Cloudflare Images filesystem driver can be used as you would use another filesystem driver. The documentation for the Laravel filesystem can be found here.

The following example shows how to use the Cloudflare Images filesystem driver to store a file.

use Illuminate\Support\Facades\Storage;

Storage::disk('cloudflare-images')->put('example.png', 'Contents');

Notes

Cloudflare Images doesnot support directories so not all filesystem methods are available. The following methods are supported:

  • fileExists
  • write
  • read
  • delete
  • visibility
  • mimeType
  • lastModified
  • fileSize
  • move
  • copy

The following methods are not supported:

  • directoryExists
  • writeStream
  • readStream
  • deleteDirectory
  • createDirectory
  • listContents

The following methods still need to be implemented:

  • setVisibility

Security Vulnerabilities

If you discover a security vulnerability within this project, please email me via developer@foodticket.nl.

Related Packages

dedmytro/laravel-cloudflare-images

Cloudflare API client and filesystem for Laravel

86,742 41
antennaio/laravel-clyde

Image uploads and manipulation for Laravel, a wrapper around Glide

2,633 29
anakadote/laravel-5-image-manager

Image resizing and cropping package for Laravel 5.

8,941 14
spatie/laravel-medialibrary

Associate files with Eloquent models

48,911,191 6,163
sumanion/laravel-cloudflare

Simple way to determine real client IP and country when using CloudFlare

3,145 9