PunchRockgroin
Current Record in Render Hook
So I came across your question as I had the same issue (getting the current record into a render hook).
I had seen elsewhere where
Filament::registerRenderHook
was being used in the getHeaderActions()
function call in individual Resource Pages, and I figured you could just pass the record along using $this->record()
. It works!
I've also used the booted() lifecycle hook which does the same. You then just get the record into the view, or pass it to a livewire component.
I would also bet you could just use Livewire events to pass whatever data you need to along to other Livewire components.
Is it the best way? Probably not, but it works for my needs until something "official" is known.3 replies