get the first item in loop in laravel code example
Example: how get the first item in foreach in laravel
@foreach($items as $item)
@if ($loop->first) First Item: @endif
<h4>{{ $item->program_name }}</h4>
@endforeach
@foreach($items as $item)
@if ($loop->first) First Item: @endif
<h4>{{ $item->program_name }}</h4>
@endforeach