van-ons/filament-attachment-library
Filament Attachment Library adds a simple attachments manager to your Filament panel: upload files, browse and select existing attachments, and store them in a central library. Includes installer command, migrations/assets, and Tailwind-ready templates.
The AttachmentField accepts the standard Filament validation rules. Look for the complete list in Filament's documentation.
Furthermore, the package also provides additional validation rules.
The AttachmentField can be restricted to specific MIME-types by calling the mime method:
[!TIP] The method also accepts wildcards such as 'image/*'.
AttachmentField::make('featured_image')->mime('image/png')
The AttachmentField provides the ability to filter by different file types by using the following methods:
AttachmentField::make('featured_image')->image()
AttachmentField::make('featured_image')->video()
AttachmentField::make('featured_image')->text()
By using these methods, you can increase readability and make it easier to oversee the use of specific file types.
The AttachmentField can accept multiple attachments by calling the multiple method:
AttachmentField::make('featured_image')->multiple()
It is also possible to specify the minimum and maximum amount of allowed files:
AttachmentField::make('featured_image')->minFiles(5)
AttachmentField::make('featured_image')->maxFiles(10)
How can I help you explore Laravel packages today?