Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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
 
PREVIOUS NEXT
Tagged: #item #foreach #laravel
ADD COMMENT
Topic
Name
9+9 =