afea / filament-media
Media gallery module for the Afea Filament CMS package ecosystem: curated media items with an image, an optional file and rich notes.
v0.1.0
2026-04-21 10:48 UTC
Requires
- php: ^8.4
- afea/filament-cms-core: @dev
- filament/filament: ^4.0
- filament/spatie-laravel-media-library-plugin: ^4.0
- illuminate/contracts: ^12.0
- illuminate/database: ^12.0
- illuminate/support: ^12.0
- laravel/prompts: ^0.3
- spatie/laravel-medialibrary: ^11.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
README
Media gallery module for the Afea Filament CMS package ecosystem.
Ships:
MediaItemmodel — title + description + rich note + two media collections (image + downloadable file) via Spatie- Reorderable Filament v4
MediaItemResourcewith RichEditor (sharesafea-cms.rich_content.blocks) MediaPlugin+afea:install:mediainstaller
Pair this with afea/filament-files when you need:
filament-media— curated press kit / gallery items (1 image + 1 optional downloadable) with rich editorial notes.filament-files— flat document/link lists grouped by a stringgroup, no editorial metadata.
Installation
composer require afea/filament-media php artisan afea:install:media
Register in AdminPanelProvider:
->plugin(\Afea\Cms\Media\Filament\MediaPlugin::make())
Three common scenarios
1. Render a gallery on a Blade page
use Afea\Cms\Media\Models\MediaItem; $gallery = MediaItem::query()->active()->ordered()->get(); foreach ($gallery as $item) { $item->imageUrl('preview'); // thumbnail $item->imageUrl(); // original $item->fileUrl(); // optional downloadable }
2. Private disk for gated press kits
AFEA_MEDIA_DISK=s3-private
Both image and file collections move to the new disk. For signed URLs use getFirstMedia('media/files')?->getTemporaryUrl(...).
3. Model override with a custom featured scope
class MediaItem extends \Afea\Cms\Media\Models\MediaItem { public function scopeFeatured($q) { return $q->active()->where('order', '<=', 6); } }
'models' => ['media_item' => \App\Models\MediaItem::class],