Feb 26, 2024
0
Level 3
AttachAction and ->recordSelectOptionsQuery
I got an Order where I can attach a Privateclass. And I only want to see Privateclasses to current Event (to which this order belongs). So this is working:
AttachAction::make()
->recordSelectOptionsQuery(fn (Builder $query, Component $livewire) => $query->where('event_id', $livewire->ownerRecord->event_id))
->preloadRecordSelect()
Now I get the dates back and can choose between them. But I also need the instructor's name through a pivot table in the same drop down. And I want to format the dates returned. Is that possible?
Please or to participate in this conversation.