Components
Media Library
Integrations
Media Column
In order to display items from the Media Library into a Filament table, the package provides a custom Filament table column called MediaColumn. This column can be used in any Filament table, both inside or outside a Filament panel.
Using the column
You can include the column like this:
All methods available on the ImageColumn class are also available on the MediaColumn class:
Depending on which driver you are using, you will need to provide either the id of the MediaLibraryItem (if you are using the medialibrary driver) or the file path (if you are using the filesystem driver).
Relationship
If you are using the MediaLibraryItem driver, it is more efficient to load the related MediaLibraryItem using a relationship. You can do this by specifying the relationship name and using the ->relationship() method:
This will eager load the related MediaLibraryItem and prevent N+1 query issues.