Laravel blade template reads comments also for processing

Viewed 107

I am using blade for very first time, and I have included a comment line. But while running the page throws an exception , found that commented line also taken for execution.

commented line :

<!-- {!! !!} changed to {{ }}.  ref : https://laravel.com/docs/5.5/blade -->

ErrorException :

<!-- <?php echo !!} changed to <?php echo e(}}.  ref : https://laravel.com/docs/5.5/blade -->
1 Answers

It is because your html comment contains {{ }} & {!! !!} which will interpret by blade.

In this case use Laravel blade comment. Add the comment between {{-- --}}.

{{-- {!! !!} changed to {{ }}.  ref : https://laravel.com/docs/5.5/blade --}}
Related