0

I'm developing a blade view on Laravel 5.4 which tests if a variable is set. If it is not set, the blade must present a little piece of html code placed into it. The problem is Laravel ignores or doesn't recognize the @isset directive rendering the string as if it was a simple html code. See the picture:

enter image description here

I have done a ugly workaround using @if(! empty($test) ). And I already tried to clean the cache with php artisan cache:clear.

Did someone know something that can cause this problem? Thanks a lot!

Milo
  • 3,365
  • 9
  • 30
  • 44
  • Is that `@endissets` a typo? If it is, change it to `@endisset` – Laerte Jan 17 '18 at 16:45
  • Yes, it is! But it does not solve the problem. (I'd be ashamed if it was a foolish typo! Thank God it wasn't! ) – Allan Vigiano Jan 17 '18 at 16:56
  • The only issue I could think about Blade printing this directive is if the version of the framework is not updated to 5.4, since `@isset` was introduced in Laravel 5.4. Otherwise it will print it as text. – Laerte Jan 17 '18 at 17:08
  • Using `php artisan --version` it returns Laravel Framework 5.4.15. It's so strange... It looks like a beginner issue but I'm developing with Laravel more than a year (this is a problem that I spent time in the first week of developing). – Allan Vigiano Jan 17 '18 at 17:22

1 Answers1

0

I solved my problem updating Laravel Framework from 5.4.15 to 5.4.36.

First, stop your server (if you are using php artisan serve).

Then run composer update on root directory of the project.

Probably you need to run php artisan cache:clear before serve the project again, in my case it wasn't necessary.

It's a strange behavior of Laravel witch probably is a little bug on Laravel Framework 5.4.15 or earlier.