Level 73
Why are you passing an obejct to the get function?
Wouldn't it be easier to just
$.get( "/get_user_music/{{ $user->id }}")
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am using Jquery in my app and in the blade.php file I am trying to send the users id.
$(document).ready(function(){
$.get( "/get_user_music", { id: @php $user->id @endphp } )
.done(function( data ) {
alert( "Data Loaded: " + data );
});
I am getting the following error in the console. What is the proper way to do this?
Uncaught SyntaxError: Unexpected token '}'
Why are you passing an obejct to the get function?
Wouldn't it be easier to just
$.get( "/get_user_music/{{ $user->id }}")
Please or to participate in this conversation.