afea / filament-files
File manager module for the Afea Filament CMS package ecosystem: uploaded files + external links, grouped and orderable.
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
File manager module for the Afea Filament CMS package ecosystem.
Ships:
Filemodel — unified listing of uploaded files (Spatie media) and external URLsFileTypeenum (Upload/Link) with label + color + icon- Reorderable Filament v4
FileResourcewith a type-aware form (upload OR link, never both) FilesPlugin+afea:install:files
Installation
composer require afea/filament-files php artisan afea:install:files
Register in AdminPanelProvider:
->plugin(\Afea\Cms\Files\Filament\FilesPlugin::make())
Three common scenarios
1. Render a group of files on a Blade page
use Afea\Cms\Files\Models\File; $brochures = File::query()->active()->inGroup('brochures')->ordered()->get(); // each file resolves to either a media URL or an external link foreach ($brochures as $file) { $file->url(); // string|null }
2. Store uploads on a private disk
AFEA_FILES_DISK=s3
The $file->url() helper keeps working — Spatie returns the disk's public URL. For signed/temporary URLs, call $file->getFirstMedia('file')?->getTemporaryUrl(...).
3. Group arbitrary external links alongside uploads
Create File records with type = link pointing at external PDFs or Google Drive sharing links — they'll appear in the same group alongside uploaded files.