koffinate/laravel-filesystem
Composer 安装命令:
composer require koffinate/laravel-filesystem
包简介
Illuminate filesystem compatibility with Minio Support
关键字:
README 文档
README
Installation
composer require koffinate/laravel-filesystem
Configuration
add this to your environment
MINIO_ACCESS_KEY_ID="minio-access-key" MINIO_SECRET_ACCESS_KEY="minio-secret-access-key" MINIO_DEFAULT_REGION="minio-region" MINIO_BUCKET="minio-bucket" MINIO_USE_PATH_STYLE_ENDPOINT=true MINIO_URL="minio-full-url-with-bucket-include" MINIO_ENDPOINT="minio-endpoint-without-bucket-included" MINIO_VISIBILITY="public"
or use default laravel aws-s3 environment,
AWS_ACCESS_KEY_ID="s3-access-key" AWS_SECRET_ACCESS_KEY="s3-secret-access-key" AWS_DEFAULT_REGION="s3-region" AWS_BUCKET="s3-bucket" AWS_USE_PATH_STYLE_ENDPOINT=false AWS_URL="s3-full-url-with-bucket-include" AWS_ENDPOINT="s3-endpoint-without-bucket-included" AWS_VISIBILITY="public"
actually if you want to use both of minio and s3 together, use AWS_ and MINIO_ on your .env.
Custom configuration
You can still customize the configuration by defining new disks with minio key to config/filesystem.php.
or use this command to generate from default config
php artisan koffinate:minio-config
Usage
use normally laravel filesystem as you go.
make sure your FILESYSTEM_DISK on .env set to minio as default,
... FILESYSTEM_DISK=minio ...
or MEDIA_DISK if using spatie/laravel-medialibrary's package.
... MEDIA_DISK=minio ...
Obtain disk usage
you can use it directly using method disk from Storage,
// put content into file Storage::disk('minio')->put('file.jpg', $contents); // read file contents $contents = Storage::disk('minio')->get('file.jpg'); // check file is exists if (Storage::disk('minio')->exists('file.jpg')) { // ... } // check file is missing or not exists if (Storage::disk('minio')->missing('file.jpg')) { // ... }
on file upload,
// store on folder $request->file('files')->store('path-to-folder', 'minio'); // store on folder with new name $request->file('files')->storeAs('path-to-folder', 'file.jpg', 'minio');
read more usage on Laravel Filesystem.
koffinate/laravel-filesystem 适用场景与选型建议
koffinate/laravel-filesystem 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.79k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 06 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「filesystem」 「s3」 「library」 「coffee」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 koffinate/laravel-filesystem 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 koffinate/laravel-filesystem 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 koffinate/laravel-filesystem 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A SDK for working with B2 cloud storage.
A PHP class providing static methods for reading, writing, copying, moving, and deleting files and directories, MIME type detection, image size detection, and file permission management
The flysystem adapter for yandex disk rest api.
A sleek PHP wrapper around rclone with Laravel-style fluent API syntax
Inbox pattern process implementation for your Laravel Applications
phpABLE file-system library
统计信息
- 总下载量: 3.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-17