'Comment in .blade.php template
I am new in blade template. How i comment here?
PHP i can comment like this
<?php // echo $games;?>
Laravel Blade
{{ $game }}
Solution 1:[1]
In blade syntax, a comment starts with {{--
and ends with --}}
{{-- this is a comment --}}
But to comment out multiple lines, use standard PHP block comments instead, like:
<?php /*
@if ($condition)
{{ HTML::form("foo") }};
@endif
*/ ?>
And never nest Blade and/or PHP code inside of Blade comments.
See also stackoverflow.com/Why Blade comment causes page to crash?
Solution 2:[2]
In laravel 8 you should use this syntax for comment
<!-- this is a comment -->
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Top-Master |
Solution 2 | Bhargav Rao |