Creating a Macro | Laravel Macros: An Easy Way to Extend Laravel Components
To create a macro, first locate the desired class to create a macro for. In the following examples, a rot13 macro will be created for the \Illuminate\Support\Str class. The first helper function will be a wrapper of PHP's str_rot13 function, which...