FilamentF
Filament9mo ago
Arjen

How to get infolist in ViewAction modal in table widget?

I've created a table widget and I'd like to get the infolist I defined in the resource for this specific model to show up when I view the record (which opens in a modal on both the resource and this table widget). I've tried adding the infolist method, but there nothing appearing inside the model. What am I missing?

class ConversationReports extends \Filament\Widgets\TableWidget
{
    public function table(Table $table): Table
    {
        return $table
            ->query(ConversationReport::query())
            ->columns([
                // ...
            ])
            ->actions([
                Tables\Actions\ViewAction::make(),
                Tables\Actions\EditAction::make()
                    ->url(fn (ConversationReport $record) => ConversationReportResource::getUrl('edit', ['record' => $record])),
            ])
            ->recordAction(Tables\Actions\ViewAction::class)
            ->recordUrl(null);
    }
    
    public static function infolist(Infolist $infolist): Infolist
    {
        return ConversationReportResource::infolist($infolist);
    }
}
Solution
on the view access class you should be able to do:
            ->recordAction(Tables\Actions\ViewAction::make('view')->infolist([schema]))
Was this page helpful?