Accessing current selection in bulk action form

Is there a way to access the currently selected elements in a bulk action modal form? I have AccountEntries which are related to Clients and also to Processes. Client hasMany Process, and I want to be able to move a group of account entries to a different process for that client. I want to load client.processes for the selected account entries to show them in a dropdown.
2 Replies
toeknee
toeknee2y ago
I think you can access it with $livewire->currentRecord(), I believe you were answred yesterday in the chat
36864
36864OP2y ago
I figured out you can get the records injected into the callback as such
BulkAction::make('changeProcess')
->form(
function (Collection $records) {
//do things with my records
})
BulkAction::make('changeProcess')
->form(
function (Collection $records) {
//do things with my records
})
Thanks!

Did you find this page helpful?