https://github.com/laravelbestpractices/messy-codebase/blob/master/app/functions.php - Put custom functions in a helpers file - OR better yet, break those down into classes that can be injected to the IoC
https://github.com/laravelbestpractices/messy-codebase/blob/master/app/functions.php