What is blade in Laravel by the way?

Blade is the easy, however powerful templating engine supplied with Laravel. unlike other common PHP templating engines, Blade does not restrict you from using plain PHP code in your views. In fact, all Blade views are compiled into plain PHP code and cached till they’re changed, which means Blade adds basically zero overhead to your application. Blade view files use the .blade.php file extension and are typically kept within the resources/views directory.

Most importantly, Blade uses its own functions also known as blade directives which are the inbuilt functions and they are interpreted in php code by templating engine. Directives are denoted as @DIRECTIVE_NAME, some of them are:

  • @extends()
  • @yields()
  • @section()
  • @php and many more…