Filament Plugins

Purchase

Media Entry

In order to display items from the Media Library into a Filament infolist, the package provides a custom Filament infolist component called MediaEntry. This component can be used in any Filament schema, both inside or outside a Filament panel.

Using the entry

You can include the entry like this:

php

MediaEntry::make('thumbnail_id')
    ->label('Thumbnail')

All methods available on the ImageEntry class are also available on the MediaEntry class:

php

MediaEntry::make('thumbnail_id')
    ->label('Thumbnail')
    ->circular()
    ->size()

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 and you have defined a relationship, you can also load the MediaLibraryItem using the relationship. You can do this by specifying the relationship name and using the ->relationship() method:

php

MediaEntry::make('featuredImage')
    ->relationship()
    ->label('Featured image')
© FilamentPlugins.com ✦ 2022 – 2025 ✦ All rights reserved.