How to do comments in Blade files?

Laravel: How to do comments in Blade files?

Comments in Blade are very simple!

You can either do normal PHP comments:

  1. <? /* some comment here */
  2. // or single line comments
  3. # or these :)
  4. ?>

Or blade comments:

  1. {{-- Blade comments that wil not appear in the rendered HTML output --}}

If you use an IDE that supports blade formatting (such as PHPStorm) then you can get it to output blade comments in the same style as normal comments.

webdevetc profile pic
webdevetc

I am a 29 year old backend web developer from London, mostly focusing on PHP and Laravel lately. This (webdevetc.com) is my blog where I write about some web development topics (PHP, Laravel, Javascript, and some server stuff). contact me here.



More...


Comments and discussion about How to do comments in Blade files?

Found this interesting? Maybe you want to read some more in this series?

Or see other topics in the Laravel language

Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScript
Or see random questions

How to make multiple routes share the same URL structure or URL parameters

What is Bubble sort, and how to write an implementation of it in PHP

How to set up an alias to map one directory to another destination

How to get the last character of a string in JS?

How can you check if a variable is alphanum (alphanumeric, letters and numbers only) in PHP?

How to block IP addresses in Apache by using regular expressions (regex) in .htaccess

How to round a number in JS?

How to fix the MySQL related "Specified key was too long error" error in Laravel

How to check if a string contains a certain substring?

What are generators in PHP, and how do they compare to arrays?