@php($array=['php','bootstrap','js','laravel']) <ul> @foreach($array as $key) <li>{{$loop->iteration}} {{$key}}</li> $endforeach </ul> index -- sort elements from 0 iteration -- sorting elements from 1 remaining -- Reverse order of elements from 0 count -- total element first -- first last -- last even -- marks even elements odd -- marks odd elements depth -- loop depth parent -- number of parent loops

laravel foreach number