Please refer to Laravel “Blade Templates” article for style–guides about Blade templates.
As decided in this issue, the following code…
<div>
@if (count($records) === 1)
<div>
…
</div>
@endif
</div>
…should be written like so:
<div>
@if (count($records) === 1)
<div>
…
</div>
@endif
</div>
In case of nested control structures and loops, align the markup with the closest template control:
<div>
@if (isset($userProfile)
@for ($i = 0; $i < 10; $i++)
<p>User {{ $i }} […]</p>
@endfor
@endif
</div