Macros

Laravel Eloquent Relationships Through Macros
Laravel 5.4 / February 02, 2017

Laravel Eloquent Relationships Through Macros

A new feature just merged into Laravel and included in the v5.4.8 update is the ability to define Macros for Eloquent Relationships. To better show how this feature works here is a screenshot by Jordan Pittman who created the original pull request: Here is that same example in a copy and paste friendly version. AppServiceProvider …