So I'm trying to convert a Laravel array into json so I can then manipulate it through javascript. Im not sure how this is achieved correctly. Here is the code, so far
@foreach ($posts as $post)
<div class="row">
<div class="col-md-8">
<div class="row">
<div class="col-md-8 tag">
<h4><strong><a href="{{{ $post>postName }}}">#{{String::title($posts->postName) }}</a></strong></h4>
</div>
</div>
<!-- ./ post title -->
</div>
</div>
<hr />
@endforeach
<script type="text/javascript">
var data = "{{ ($posts) }}"; // ??
console.log(data);
</script>