in javascript i am trying to achive some result in laravel blade using
<script>
var $a = 10;
var productIn = @json($product->where('category_id' , $a)->pluck('id')->toArray());
console.log(productIn);
</script>
if i use 'category_id' , 10
it works fine but if i use $a
blade view gives error undefined variable $a
i have searched a lot but i think no body asked this question any idea will be preferable thanks