Answers for "get first in loop laravel"

PHP
2

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
Posted by: Guest on February-02-2021

Browse Popular Code Answers by Language