I would like to put a foreach to an array using blade in laravel, below is what I have attempted and no success
@foreach($lists as $list)
<? $tags = $list->name ?>
@endforeach
<?php
$arr = array($tags);
?>
The result to the code above is:
$arr = array(name1);
I would like to get is:
$arr = array('name1', 'name2', 'name3', ...);
I'm using laravel 5.4