@foreach ($brands as $brand) @php $initial = substr(trim($brand->name), 0, 1); @endphp @endforeach