Facades

Static-like access to container services

Facades provide a convenient static-like interface to services in the container.

Facades provide a static-like syntax that resolves to an object from the container under the hood.

Cache::get('key')
You write this
resolves to
app('cache')->get('key')
Container does this
PHP
// These do the same thing:

// Using facade (static-looking)
Cache::get('key');

// What actually happens:
app('cache')->get('key');

// Using dependency injection
public function index(CacheManager $cache) {
    $cache->get('key');
}