承接 blax-software/laravel-files 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

blax-software/laravel-files

Composer 安装命令:

composer require blax-software/laravel-files

包简介

Universal Laravel file management system — upload, optimize, serve, and attach files to any model.

README 文档

README

Blax Software OSS

Laravel Files

A universal, plug-and-play file management system for Laravel. Upload, optimize, serve, and attach files to any Eloquent model — with disk-agnostic storage, automatic image optimization, chunked uploads, and a built-in warehouse endpoint.

Features

  • Attach files to any model — polymorphic MorphToMany relationship via the HasFiles trait
  • Role-based attachments — tag files as avatar, gallery, document, etc. using the FileLinkType enum or custom strings
  • Disk-agnostic — works with any Laravel filesystem disk (local, S3, GCS, …)
  • Automatic image optimization — on-the-fly resizing and WebP conversion via spatie/image
  • Chunked uploads — upload large files in pieces with real-time progress broadcasting
  • Warehouse endpoint — a single route that resolves and serves any file by UUID, encrypted ID, or asset path
  • UUID primary keys — every file gets a unique, non-sequential identifier
  • Artisan cleanup — remove orphaned files that are no longer attached to any model

Quick Start

composer require blax-software/laravel-files

Publish the config and migrations:

php artisan vendor:publish --tag=files-config
php artisan vendor:publish --tag=files-migrations
php artisan migrate

Add the trait to any model:

use Blax\Files\Traits\HasFiles;

class User extends Model
{
    use HasFiles;
}

Attach a file:

use Blax\Files\Enums\FileLinkType;

$user = User::find(1);

// Upload and attach in one call
$file = $user->uploadFile($request->file('avatar'), as: FileLinkType::Avatar, replace: true);

// Get the avatar back
$avatar = $user->getAvatar();
echo $avatar->url;       // → /warehouse/019d8ab8-…
echo $avatar->size_human; // → "2.4 MB"

Documentation

Guide Description
Installation Requirements, installation, configuration
Attaching Files The HasFiles trait, roles, attach/detach, reordering
File Operations Creating files, reading/writing contents, duplication, scopes
Uploading Single uploads, chunked uploads, progress events
Serving Files The Warehouse, inline responses, downloads
Image Optimization On-the-fly resizing, WebP, quality control
Configuration Full reference for config/files.php
Artisan Commands files:cleanup and maintenance

Optional Dependencies

Package Purpose
spatie/image ^3.8 Image optimization and resizing
blax-software/laravel-roles Access control on the warehouse endpoint
blax-software/laravel-websockets Real-time chunk upload progress via WebSockets

Testing

composer test
# or
./vendor/bin/phpunit

License

MIT — see LICENSE for details.

Star History

Star History Chart

blax-software/laravel-files 适用场景与选型建议

blax-software/laravel-files 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「media」 「image」 「upload」 「files」 「optimization」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 blax-software/laravel-files 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 blax-software/laravel-files 我们能提供哪些服务?
定制开发 / 二次开发

基于 blax-software/laravel-files 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 37
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-17