Last active
June 26, 2018 14:08
-
-
Save arturmamedov/c1463cc316f0bb913372081a2bf0d2ad to your computer and use it in GitHub Desktop.
Blade tips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of if and isset, directly isset Laravel v5.4 | |
@isset($aVar) | |
// if (isset($aVar)) | |
@else | |
// else | |
@endisset | |
Loops | |
@foreach ($users as $user) | |
@if ($loop->first) | |
This is the first iteration. | |
@endif | |
@if ($loop->last) | |
This is the last iteration. | |
@endif | |
<p>This is user {{ $user->id }}</p> | |
@endforeach |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://laravel-news.com/five-useful-laravel-blade-directives