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()

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email