Trying to access a variable within blade syntax has posed a challenge for me:
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) }}"
}
},
However, I encountered the following error message:
Use of undefined constant resp - assumed 'resp'
I am seeking a solution on how to properly access this variable within the syntax structure.