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
Hugo10mo ago
try with request()->route() ?
cheesegrits
cheesegrits10mo 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
krekas10mo ago
Yeah he didn't mention the important part that this is from a nested resource package