Extending Blade
Blade even allows you to define your own custom directives. You can use the directive method to register a directive. When the Blade compiler encounters the directive, it calls the provided callback with its parameter.
The following example creates a @datetime($var) directive which formats a given $var: