declare php variable in javascript blade code example
Example: laravel variable in javascript
<script>
var data = {!! json_encode($data, JSON_HEX_TAG) !!};
</script>
<script>
var data = {!! json_encode($data, JSON_HEX_TAG) !!};
</script>