Laravel Custom Model Methods

Whenever I add additional logic to Eloquent models, I end up having to make it a static method (i.e. less than ideal) in order to call it from the model’s facade. I’ve tried searching a lot on how to do this the proper way and pretty much all results talk about creating methods that return portions of a Query Builder interface. I’m trying to figure out how to add methods that can return anything and be called using the model’s facade.

Laravel 5.5 PHPunit Test – “A facade root has not been set.”

When I do a try/catch on the DB::Connection()->getPdo();, I get the error A facade root has not been set. I believe it was happening with the Schema facades too before I tried adding the try/catch. The tests directory is, of course, outside of the app directory, and I have a feeling it has something to do with that, but I have not succeeded in figuring it out.