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])),
];
}
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])),
];
}
1 Reply
Dan Harrin
Dan Harrin2y ago
->modalContent(fn ($record) => view('livewire.modal-content', ['record' => $record))
Want results from more Discord servers?
Add your server