I believe that what you are looking for could be something like this: // have your array in php tags // $ arr = ['one', 'two', 'three'] ;? > // go through the array with foreach and if the counter of the array is not equal to the las element, then put coma after it
@foreach ($arr as $key => $value)
@if( count( $arr ) != $key + 1 )
{{ $value }},
@else
{{ $value }}
@endif
@endforeach
dexuu source
share