igamov/filament-media-gallery
最新稳定版本:v1.0.0
Composer 安装命令:
composer require igamov/filament-media-gallery
包简介
This package add support spatie media library to filament V3.x
README 文档
README
This package add support spatie media library to filament V3.x
I've taken inspiration from the following plugins: Json Media & Filament Spatie Media Library.
Installation
You can install the package via composer:
composer require igamov/filament-media-gallery
Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-media-gallery-views"
Usage
In Filament Forms
use Igamov\FilamentMediaGallery\Form\MediaGallery; MediaGallery::make('gallery') ->collection('gallery') ->thumb('tiny_conversion') ->disk('disk') ->columnSpanFull() ->reorderable(true) ->downloadable() ->maxSize(1536) ->multiple()
In Filament Tables
To use the media gallery image column:
use Igamov\FilamentMediaGallery\Tables\Columns\MediaGalleryImageColumn; MediaGalleryImageColumn::make('avatar')
The media gallery image column supports all the customization options of the original image column.
Passing a collection
Optionally, you may pass a collection():
use Igamov\FilamentMediaGallery\Tables\Columns\MediaGalleryImageColumn; MediaGalleryImageColumn::make('avatar') ->collection('avatars')
The collection allows you to group files into categories.
By default, only media without a collection (using the default collection) will be shown. If you want to show media from all collections, you can use the allCollections() method:
use Igamov\FilamentMediaGallery\Tables\Columns\MediaGalleryImageColumn; MediaGalleryImageColumn::make('avatar') ->allCollections()
Using conversions
You may also specify a conversion() to load the file from showing it in the table, if present:
use Igamov\FilamentMediaGallery\Tables\Columns\MediaGalleryImageColumn; MediaGalleryImageColumn::make('avatar') ->conversion('thumb')
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 54
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-28