-
Notifications
You must be signed in to change notification settings - Fork 255
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
Is there any way to make route().current() also match params? #211
Comments
This is a good idea. I mayyyyy have time for it tomorrow, but I can't be sure and if not it will be a couple weeks. |
@DanielCoulbourne Sorry to bother you, but is there any progress on this? :D |
I would like to see that Example: |
I just ran into this myself. It would be awesome if Ziggy handled this out of the box! 👌 |
Just remembered this is already possible, it's |
This was added in #330 and will be available shortly in Ziggy |
That's so awesome! Thank you @bakerkretzmar. Also, hurray for |
Expected Behavior
Some way to determine that the route matches, including params. For example, if I'm on any of the following pages,
route().current('backend.inventory.show')
returns true because the route name is the same for all:Current Behavior
I'm not sure if there is already some method or argument to a method that will allow me to determine this.
For bug reports only please provide
Currently installed Laravel version:
5.8.15
Currently installed Ziggy version
0.7.1
Example route from your Laravel Routes file.
Contents of Ziggy.namedRoutes
Ziggy call in context
I have a custom Vue directive that uses the
href
attribute to determine if the link is to the current page. The link'shref
will be a route:<a :href="route('backend.inventory.show'. { tenant: currentTenant, category: category.id })">{{ category.name }}</a>
The text was updated successfully, but these errors were encountered: