route current

inside a livewire component ''' $list[$singularSlug] = Route::current()?->parameter( $singularSlug, $urlParameters[$singularSlug] ?? null ); ''' but route::current() retunr null .. how can i fix it ? thanks a lot
3 Replies
Hugo
Hugo17mo ago
try with request()->route() ?
cheesegrits
cheesegrits17mo ago
Where inside a Livewire component? If it's in the mount method then route() should behave like I think you are expecting, but in any method called through Livewire magic, I don't think it will.
krekas
krekas17mo ago
Yeah he didn't mention the important part that this is from a nested resource package

Did you find this page helpful?