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 )}} ];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.