PHP code inside a Laravel 5 blade template

According to documentation, in Laravel 5.2 and newer you can use the following code:

@php
{{-- PHP code here --}}
@endphp

Alternatively, you can extend the Blade templating engine as it’s described here.

If neither of the above solutions is suitable, you are stuck with the answers given by Armen and by Gonzalo.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)