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.
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"
use Igamov\FilamentMediaGallery\Form\MediaGallery;
MediaGallery::make('gallery')
->collection('gallery')
->thumb('tiny_conversion')
->disk('disk')
->columnSpanFull()
->reorderable(true)
->downloadable()
->maxSize(1536)
->multiple()
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.
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()
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')
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.