How to get page reference from resource
Hello!
I have a set of pages (list/create/edit) that have url attribute, something like
How can access this attribute from methods in corresponding resource? (In
form
or table
methods)
I'm sorry if this is a dumb question, but I'm pretty new in Livewire and Filament ecosystem.Solution:Jump to solution
Thanks a lot! That pointed me in the right direction.
Also, there is even a simpler way, there is a
getLivewire()
available on table and form components:
...2 Replies
You can access the current page object using the
$livewire
hint on supported Filament closures: https://filamentphp.com/docs/3.x/forms/advanced#injecting-the-current-livewire-component-instance
You can then use PHP's ReflectionObject
to inspect the attributes on that $livewire
compoonentSolution
Thanks a lot! That pointed me in the right direction.
Also, there is even a simpler way, there is a
getLivewire()
available on table and form components: