I found another way to do this, which places my macros in a file called macros.php , then puts it in the app/ directory along with filters.php and routs.php , and then in app/start/global.php I added the following line in the end
require app_path().'/macros.php';
this will load your macros after starting the application and before the view is built. it smoothes more accurately and follows the Laravel convention because it is the same that Laravel uses to load the filters.php file.
source share