What is the difference between CI4 services and Laravel facades?

Answer

Both CI4 Services and Laravel Facades provide convenient access to framework functionality, but they work differently. Laravel Facades use PHP's static method calls proxied to underlying objects resolved from the container: Cache::get("key") resolves the cache manager from the DI container and calls get(). They feel like static calls but are actually instance methods on container-resolved objects, maintaining testability. CI4 Services are explicit factory methods returning shared instances: service("cache")->get("key") or \Config\Services::cache()->get("key"). Services are more transparent — you can see exactly which class is being returned. Facades are more concise. Both support mocking in tests: Laravel uses Cache::shouldReceive(), CI4 uses Services::injectMock(). CI4 services have lower "magic" overhead and are more predictable, while Laravel facades are more ergonomic for everyday use.