I tried to access variable inside blade syntax:
success: function(resp) {
console.log(resp)
var MsgClass = 'alert-danger';
$("#overlay").hide();
if(resp.success) {
MsgClass = 'alert-success';
window.location.href = "{{ asset('public/exports/'+resp.filename) }}"
}
},
But I get
Use of undefined constant resp - assumed 'resp'
How can I get this variable inside the syntax?
{{ asset('public/exports/') }} + resp.filename