I'm trying to access this laravel URL inside Javascript:
var id = 2;
var href = '{{ URL::to('/bus/'+ id +'') }}';
I tried to escape the single quote and \ before it, like this:
var id = 2;
var href = '{{ URL::to(\'/bus/'+ id +'') }}';
It's giving me this error:
Parse error: syntax error, unexpected ''/bus/'' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING)