Laravel Macros

Laravel Tip: 5 examples of why you should be using Macros

https://medium.com/@SlyFireFox/laravel-tip-5-examples-of-why-you-should-be-using-macros-90e015d1bce

To cover what a macro is briefly, it’s a way of extending a class’ methods but without using inheritance and instead it works by adding a Closure to a class. This then means that all instances of that class has that newly added method. Any class that has uses the Macroable trait found in the Laravel framework can have macros applied to them.

Blogbook : PHP | Javascript | Laravel | Corcel | CodeIgniter | VueJs | ReactJs | WordPress