Carlos
Carlos
FFilament
Created by Carlos on 6/7/2024 in #❓┊help
Get Collection from related model using Spatie Media Library plugin
Hello, in my project we use spatie media library to manage media files, let's say that I have 2 models and one belongsTo the other: Hotel and Room, Hotel has a media collection, i.e. "hotel_photos". What approach do I need to display the "hotel_photos" in the HouseResource form? the component SpatieMediaLibraryFileUpload only retrieves collections that belongs to the $record. Thanks.
3 replies
FFilament
Created by Carlos on 5/9/2024 in #❓┊help
Conditionally rendering an icon in TextColumn
I have a situation where the value of a cell could be "true" or anything else. How can I render an icon instead of text in a TextColumn, I tried this but it didn't work:
Tables\Columns\TextColumn::make('value')
->formatStateUsing( fn($state) => $state === 'true' ? new HtmlString(Blade::render('<x-filament::icon icon="heroicon-o-check" class="w-4 h-4"/>')) : $state ),
Tables\Columns\TextColumn::make('value')
->formatStateUsing( fn($state) => $state === 'true' ? new HtmlString(Blade::render('<x-filament::icon icon="heroicon-o-check" class="w-4 h-4"/>')) : $state ),
Thanks!
6 replies