Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

route().current() not working for base route #200

Closed
reinink opened this issue Feb 20, 2019 · 7 comments
Closed

route().current() not working for base route #200

reinink opened this issue Feb 20, 2019 · 7 comments

Comments

@reinink
Copy link
Contributor

reinink commented Feb 20, 2019

I have a dashboard route defined in Laravel:

Route::get('/')->name('dashboard')->uses('DashboardController@index');

But when I call route().current() on the dashboard page (/), this function returns undefined.

I would have expected dashboard.

@andriihorpenko
Copy link

Confirmed, same is happening to me.

@DanielCoulbourne
Copy link
Contributor

Thanks for this. Sorry for slow replies on all the recent issues. Haven't had a ton of 20% time lately. Hopefully this weekend or next week

@object505
Copy link

I got the same issue. In Ziggy.namedRoutes object I can see the route name:
home: {uri: "/", methods: Array(2), domain: null} but when using route().current() I get undefined.
Any plans when this will be fixed?

@maxxscho
Copy link

Same here - base route isn't working with route().current(). I guess something with the trailing slash?

@DanielCoulbourne
Copy link
Contributor

This should be fixed in the latest build, which I'll tag today.
Screen Shot 2019-04-26 at 5 47 31 PM

@reinink
Copy link
Contributor Author

reinink commented Apr 27, 2019

Thanks @DanielCoulbourne!

@maxxscho
Copy link

Works like a charm. Thank you @DanielCoulbourne !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants