I would like to know in Laravel, in saying the name of the route, it accepts the variable, instead of the name itself, such as:
Example: Instead of being like this:
{{ route('minhaRota') }}
Look like this:
var minhaRota = 'minhaRota'
{{ route( minhaRota ) }}
But so it gives me an undefined constant warning
I'm trying to do this with javascript
As I want to reuse code, and I will use the same page for other types of operations, I would not like to be copying code to another file, I would just send a variable with the current route to the end of a certain operation back to where was.
To get the current route I'm using this way:
let currentUrl = '{{ Route::getCurrentRoute()->action['as'] }}'
Then I send this current url to a form so that when it finishes the operation (save, edit) it goes back to where it was before currentUrl