How can we pass a record object to the modal content

Hello,

I'm having a list record through the livewire component and I've used Tables\Actions\ViewAction and wanted to display custom modal content through this. But I don't know some how $record is not passing through the modal content blade file.

protected function getTableActions(): array
{
    return [
        Tables\Actions\ViewAction::make('view')
            ->label('')
            ->icon('heroicon-s-eye')
            ->modalContent(view('livewire.modal-content', ['record_id' => fn($record) => $record->id])),
    ];
}
Was this page helpful?