I want to be clear. I love the facade system in Laravel. It’s useful. It’s powerful. But it can also be a pain in the ass. Learning when to use, or not use facades and instead rely on dependency injection can not only help keep your code easier to maintain, but also easy to work with in the future.

Don’t know what facades are? Facades in Laravel are a simple wrapper to a more complex system, providing static method access to objects that have been previously configured in a service provider, either by Laravel itself or by you. It allows ease of use and rapid development, avoiding having to inject every single one of your dependencies in your code.

In Laravel 5, Taylor took this a step further and wrote wrapper functions (such as view() and redirect()) to make our code look really readable and lovely to work with. However, is there an issue with using these functions and facades? Should you be using them? The short answer is yes. The longer answer contains that horribly vague phrase “it depends”. Let’s explore.