How to get current route and params inside updateStateUsing?
So i have a widget that will set a params to the url after click. But in the updateStateUsing i cant seems to get the params.
What i have:
1. 'products/merchant_id=1' as url and i can access this at public static table function through request() helper.
2. I have a TextInputColumn and using updateStateUsing. when i dd(request()) inside updateStateUsing, it seems like the requests has been changed.
Or am I in the right direction?
Solution:Jump to solution
You can take what you need from the request in the
mount()
method of your page and put it in a public property7 Replies
Up.
Don't do this, it's not reliable
Solution
You can take what you need from the request in the
mount()
method of your page and put it in a public propertyThen access it like this
By saying not reliable, do you mean updateStateUsing? Any recommendation is welcome too!
This works fine for me thanks a lot.
No he means accessing
request()
. You are getting different output because it's a Livewire request, so the URL has changed.Ah understand. Thanks for the input Dennis!