Facades are a feature of the Laravel framework that provide a static-style interface to classes registered in the application's service container. They allow expressive, memorable syntax while still keeping the underlying object testable and configurable, since a facade is really just resolving an object from the container at runtime.
use Illuminate\Support\Facades\Cache;
Cache::put('key', 'value', 600);
$value = Cache::get('key');
Although Cache::put() looks like a static method call, it is actually being called on an underlying object resolved dynamically from the service container.
Every facade class extends Laravel's base Facade class and defines a getFacadeAccessor method returning the name of the service it represents. PHP's __callStatic magic method intercepts static calls and forwards them to the resolved instance.
Facades and constructor-based dependency injection can generally be used interchangeably, since both resolve the same underlying class from the container. Facades favor brevity and readability, while dependency injection makes a class's dependencies explicit in its constructor signature.
Laravel also supports "real-time facades," which let any class in the application be used as if it were a facade by prefixing its namespace with Facades\ at the point of use, without needing to create a dedicated facade class.
By: Tomas Silny
Edited: 2026-08-13 03:31:19