beestreams/laravelimageable
Composer 安装命令:
composer require beestreams/laravelimageable
包简介
Add images to your models. Resizes images
README 文档
README
Usage
- Install via composer
- If Laravel 5.4 or lower, add service provider
Beestreams\LaravelImageable\ImageableProvider::class - run
php artisan vendor:publish --tag=config - Migrate database
- Include Imageable trait on models
- Set upload path on model
protected $imagePath = 'example/' - When file is available, add it to model
$model->attachImage($file);
When file is added to model, it first persists an Image model to DB it then saves the file to specified path. You can set sizes in config to make several images. These are jobs dispatched to queue. For each image size it makes an additional model. When model is deleted, it also deletes the file. When original model is deleted all related models and files are deleted
For method list see Imageable trait or IntegrationTest
If you want alt_text and description for your files … support for that is coming
TODO:
- Get file from url (route and response)
- Multiple file types support
- SVG support
- create failsafe in ResizeImage job. If size does not exist, fail gracefully
- Integrationtest is a test-dump. Clean up and refactor
- Fix hacky Job handle method
- Whats up with all the save methods?
- External storage services
- Delete all sizes on delete
- Create controller for image and refactor routes file
- If file directory is empty remove directory on delete
Important
There is no validation in this package, please validate your requests before using.
Vendor publish
If you need to modify migrations, models or traits you can ´vendor:publish´ this package. (not tested)
beestreams/laravelimageable 适用场景与选型建议
beestreams/laravelimageable 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 123 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 08 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 beestreams/laravelimageable 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 beestreams/laravelimageable 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 123
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-17