Use $loop variable

This commit is contained in:
James Brooks 2017-03-09 19:28:04 +00:00
parent 9a56625f09
commit ecb05d588f
2 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,8 @@
<h4>{{ formatted_date($date) }}</h4>
<div class="timeline">
<div class="content-wrapper">
@forelse($incidents as $incidentID => $incident)
<div class="moment {{ $incidentID === 0 ? 'first' : null }}">
@forelse($incidents as $incident)
<div class="moment {{ $loop->first ? 'first' : null }}">
<div class="row event clearfix">
<div class="col-sm-1">
<div class="status-icon status-{{ $incident->latest_human_status }}" data-toggle="tooltip" title="{{ $incident->latest_human_status }}" data-placement="left">

View File

@ -18,8 +18,8 @@
@if($incident->updates)
<div class="timeline">
<div class="content-wrapper">
@foreach ($incident->updates as $index => $update)
<div class="moment {{ $index === 0 ? 'first' : null }}" id="update-{{ $update->id }}">
@foreach ($incident->updates as $update)
<div class="moment {{ $loop->first ? 'first' : null }}" id="update-{{ $update->id }}">
<div class="row event clearfix">
<div class="col-sm-1">
<div class="status-icon status-{{ $update->status }}" data-toggle="tooltip" title="{{ $update->human_status }}" data-placement="left">