Is there a way to pass a route to js? #647
-
Probably I dreamed but ... Am I wrong or there is a recently added I would like to avoid to hardcode an url into js when doing ajax calll |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @realtebo , it was probably a dream yes 🌨️ ! We don't have such helper and AFAIK there is no |
Beta Was this translation helpful? Give feedback.
-
Hey @realtebo , maybe you saw this package we use sometimes? https://github.com/Laravel-Backpack/CRUD/blob/9f494d6e3a330f849ccd10c6570622f9e7844da9/src/resources/views/crud/inc/filters_navbar.blade.php#L29 ? |
Beta Was this translation helpful? Give feedback.
Hey @realtebo , it was probably a dream yes 🌨️ ! We don't have such helper and AFAIK there is no
route()
helper in JS, no.You can use the current URL as the base, but that's just normal JS.