inweb/media
最新稳定版本:9.0.6
Composer 安装命令:
composer require inweb/media
包简介
Media components for InWeb framework
README 文档
README
Media files manipulation
Requirements
- Laravel >=5.7
Installation
- Install package via composer require
or add to your composer.json to require section and update your dependenciescomposer require inweb/media"inweb/media": "*" - Run migrations
php artisan migrate
You are ready to go!
Usage
Add trait to your model (InWeb\Base\Entity)
use InWeb\Media\WithImages;
For thimbnails implement method:
use InWeb\Media\Thumbnail;
...
public function getImageThumbnails()
{
return [
'catalog' => new Thumbnail(function (\Intervention\Image\Image $image) {
return $image->resize(100, 100, function (Constraint $c) {
$c->aspectRatio();
$c->upsize();
})->resizeCanvas(100, 100);
}, true),
];
}
Thumbnail class receives 2 parameters:
- Closure with \Intervention\Image\Image object
- Boolean - Only for main image (default - false)
You can specify original thumbnail name to manipulate with original image.
public function getImageThumbnails()
{
return [
'original' => new Thumbnail(...),
];
}
统计信息
- 总下载量: 232
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-22