Pinax is a media library for Filament applications. It stores uploaded file metadata in a polymorphic media table and provides gallery, upload and infolist components with folders, ordering and semantic marks.
- Polymorphic media attachments for any Eloquent model.
- Configurable filesystem disk, base directory and database connection.
MediaUploadfor a single upload workflow.MediaGalleryfor multiple ordered files.- Named
Markvalues such as cover, primary or featured, including unique/default behavior. MediaEntryfor image display in Filament schemas.- Optional tenancy and policy-backed media management.
composer require phpinnacle/pinax
php artisan vendor:publish --tag="phpinnacle-pinax-migrations"
php artisan migrateFor the default public disk, ensure its storage link exists:
php artisan storage:linkRegister PinaxPlugin::make() in the Filament panel. Publish phpinnacle-pinax-config to change upload.disk, upload.folder, connection or tenancy.
use PHPinnacle\Pinax\Forms\MediaGallery;
use PHPinnacle\Pinax\Mark;
MediaGallery::make('gallery')
->disk('public')
->directory('products')
->marks(
Mark::make('cover')->label('Cover')->unique()->default(),
Mark::make('featured')->label('Featured'),
);The Media model also exposes fetch(), store(), clear(), one(), single() and folder() for application-level access. Public URLs require a disk capable of generating accessible URLs.
composer testSee CHANGELOG. Released under the MIT License.