I am not able to set my javascript variable for my blade file:
$filterCoupons = data;
I want to use this variable in a loop.
I am not able to set my javascript variable for my blade file:
$filterCoupons = data;
I want to use this variable in a loop.
You can do this
<script>
let data = {{json_encode($filterCoupons)}}
</script>
Or you can put all filters into array
var data = [ {{ implode(",", $filterCoupons )}} ];