foodticket/laravel-filesystem-cloudflare-images 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

foodticket/laravel-filesystem-cloudflare-images

最新稳定版本:v0.0.15

Composer 安装命令:

composer require foodticket/laravel-filesystem-cloudflare-images

包简介

A Laravel filesystem driver for Cloudflare Images

README 文档

README

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.0
  • Laravel >= 9.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.

统计信息

  • 总下载量: 8.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-20