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.

That's all the code you need to help clean up your blade templates and create your own blade directives. https://paulund.co.uk/how-to-create-a-custom-blade-directive#view-cacheOne thing to remember is that Laravel will cache your view files with the compiled code from your custom blade directives.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners