Closed B3K4682 closed 3 years ago
If you're trying to echo out the number 2
somewhere in a Blade template it would probably look something like route('admin.user.details', {{ $user->id }})
, if you're in Javascript or a Vue template or something and you have a Javascript user
variable, it would be route('admin.user.details', user.id)
.
I have $user variable but it's not finding and getting error ,,users is not defined".
userView = route('admin.user.details', users.id);
I can't tell if you're in a Javascript file or a Blade template, but that error isn't coming from Ziggy—you'll need to make sure you have defined a user
or $user
variable. In Blade you would probably need to pass it to the view from your controller, in Javascript it will depend a lot on your setup. Can you share a longer snippet of the file you're working with?
Ops nvm, I fixed it. In javascript file I had no User variable 😆
Hello, I want to generate every user id in datatable I'm using:
route('admin.user.details', 2 )
But at the number (2) I want to use $user->id. but it's javascript error - " > " is undefined.How to do that?