Blade Template Doesn’t Work in Laravel 5

No, that’s not true the Blade Template is still working in Laravel 5, but its tag directive has been changed. For some of you who don’t read the Laravel development change log may not know about this. The documentation said that “For better security by default, Laravel 5.0 escapes all output from both the {{ }} and {{{ }}} Blade directives”. So, what is the new directive?

Laravel 5 Blade Tag Directive

I guess you have searched about this at Google but you found the Smarty engine as a number one search result wasn’t it? Then, how to make the Blade template work or what’s the new Blade tag directive?

Now, the tag directive to make it work is by using {!! as an opening tag and !!} as a closing tag. That’s simple but takes time to find out.

Using the old Blade tag directive {{ }} will escape your PHP script as HTML and it’ll be shown.

I like the old Blade tag directive because it doesn’t contain warning sign “!” Psychologically, it makes me like being hurry or being scold. Don’t know why Taylor Otwell did that to us, that’s so evil :( hahah just jokin’.