To make a "is-current" vue, i needed to compare the current url and the one we are. Of course, hard writing the comparison like "recipe/index" is not good, so i thought about using a route ... except that routes return a "/recipe/index?" thing so I tried
substr(route("recipe.index", '', FALSE), 1, -1)
which work great but ... it's a bit heavy don't you think ? Is there a way to have a current_uri('recipe.index') thing ? Like when we use a php artisan route list.
Thank you in advance
Have you checked any of the existing methods on the Route facade? Route::currentRouteName() sounds relevant, and Route::currentRouteNamed(...$patterns) if you need to check for several names.
if (Route::currentRouteNamed('recipe.index')) {
// Logic goes here.
}
For more stuff, look at https://laravel.com/docs/5.5/routing#accessing-the-current-route
This repo is for bug tracking. Use the forums or slack channel for solving your issue
@Dylan-DPC Not an issue neither a bug, but a proposition of new functionnality, I'm not sure slack or a forum is well qualified to put it there ...
@Epistol then we have laravel/internals repo for future proposals 馃憤