Download the PHP package ghijk/cloudflare-super-images without Composer

On this page you can find all versions of the php package ghijk/cloudflare-super-images. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cloudflare-super-images

Cloudflare Super Images

A Laravel package for Cloudflare Images. Build flexible delivery URLs, mint Direct Creator Upload URLs, verify uploads, and clean up assets, all from a clean, fluent API.

What it does

This package relies on Flexible Variants being enabled on your account (Dashboard, Images, Hosted Images, Delivery) so arbitrary transformation parameters such as w=600,fit=cover render.

Installation

Publish the config file:

Configuration

Add your Cloudflare credentials to .env:

Variable Purpose
CF_ACCOUNT_ID Your Cloudflare account ID.
CF_ACCOUNT_HASH Public-safe Images delivery hash (Images, Hosted Images, Developer Resources). Safe to expose in markup.
CF_IMAGES_TOKEN API token with Account, Cloudflare Images, Edit, used to mint upload URLs and manage assets.

Building delivery URLs

The builder casts to a string, so you can use it directly in markup or pass it anywhere a string is expected.

Blade component

Any extra attributes (alt, class, loading) pass straight through to the rendered <img> tag.

Inertia (React and Vue)

The package ships React and Vue components that build delivery URLs on the client from an imageId, so one image can render at many sizes without a server prop per variant. They share a small TypeScript port of the URL builder.

Publish the stubs into your app, where your existing Vite and TypeScript pipeline compiles them:

This copies buildImageUrl.ts, react/CloudflareImage.tsx, and vue/CloudflareImage.vue into resources/js/vendor/cloudflare-super-images.

Share your public delivery hash once so the components can read it. In app/Http/Middleware/HandleInertiaRequests.php:

Then use the component. Options map onto the same names as the PHP builder, and extra attributes pass through to the <img>:

If you would rather not share the hash globally, pass it explicitly with an accountHash prop. To keep the URL built on the server instead, drop the components and pass CloudflareImages::url($id)->...->toString() as a plain string prop.

Direct Creator Upload

Mint a one-time upload URL and hand it to the browser:

The browser then POSTs the file directly to $upload->uploadUrl. Once that completes, verify the asset before persisting anything that points at it:

Reading and deleting assets

How upload works

Testing

The package ships with Http::fake() driven tests for the API client and pure unit tests for the URL builder.

Credits

Ported from a TanStack Start on Cloudflare Workers demo into a reusable Laravel package.

License

The MIT License (MIT). Please see License File for more information.


All versions of cloudflare-super-images with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^10.0||^11.0||^12.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ghijk/cloudflare-super-images contains the following files

Loading the files please wait ...