illuminate/contracts
Laravel’s core contract interfaces for frameworks and packages. Provides stable abstractions for services like cache, queue, events, routing, validation, and more, enabling clean dependency injection and easy swapping of implementations across the ecosystem.
The package is a foundational layer for Laravel's dependency injection system, serving as pure interface definitions for core services. It is not designed for standalone use and must be paired with Laravel's service container and concrete implementations. This makes it highly aligned with Laravel's architecture but incompatible with non-Laravel PHP stacks without significant adaptation.
Integration feasibility is high within Laravel applications (as it's a transitive dependency of laravel/framework), but zero feasibility for standalone use. Attempting to use it outside Laravel results in runtime failures due to missing concrete implementations. The package's design assumes the presence of Laravel's container and ecosystem, making integration only viable in contexts where Laravel is already present.
Technical risks include version skew between illuminate/contracts and the Laravel framework, which causes interface incompatibilities (e.g., missing methods or type changes). Developers may mistakenly attempt direct usage without realizing it requires Laravel's container, leading to "class not found" errors for concrete services. The lack of standalone dependencies (beyond PSR standards) creates hidden risks if developers bypass Laravel's bootstrapping.
Key questions: How does the team ensure version alignment between illuminate/contracts and the Laravel framework?
How can I help you explore Laravel packages today?