in Laravel

How To Create A Custom Blade Directive

Blade is a PHP templating framework to use with your Laravel application. The blade templates are compiled down to normal PHP code. We can also extend blade by creating our own custom functions and directives to make our templates easier to handle.

Blade already comes with a load of it's own directives which can be found in laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php. These allow you to use shortcuts for things like htmlentities by using @e()

Login to access all content on Paulund

Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email