You can use any plain PHP code in Blade template in addition to to Blade syntax. What do you want to achieve ?
Jun 27, 2015
3
Level 8
PHP code inside Laravel 5 Blade Template
I have to place some PHP code inside Laravel 5 Blade Template. Like below
@foreach ($farmer->tasks as $task) @if ($task->pivot->due_at) < date(now)) $style = 'alert alert-danger'; @elseif ($task->pivot->due_at) > date(now)) $style = 'alert alert-success'; @else $style = ''; @endif @endforeach
Which is the actual procedure to place PHP code inside Laravel 5 Blade Template ??
Please or to participate in this conversation.