phpinnacle / pinax
Polymorphic media management for Laravel Filament applications.
Requires
- php: ^8.4
- spatie/laravel-package-tools: ^1.92
This package is auto-updated.
Last update: 2026-09-01 15:41:43 UTC
README
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.
Features
- 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.
Installation
composer require phpinnacle/pinax
php artisan vendor:publish --tag="phpinnacle-pinax-migrations"
php artisan migrate
For the default public disk, ensure its storage link exists:
php artisan storage:link
Register PinaxPlugin::make() in the Filament panel. Publish phpinnacle-pinax-config to change upload.disk, upload.folder, connection or tenancy.
Gallery usage
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.
Testing
composer test
Changelog and license
See CHANGELOG. Released under the MIT License.