Illuminate Contracts

Laravel's package of framework interfaces defining contracts for its core services.

Library
Composer
vv13.26.1
707stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
53/100Fair
Development Activity52
Maintenance0
Community80
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture84
Code Quality82
Innovation68
Learning Curve80

Illuminate Contracts is the package of interfaces that defines the contracts (abstractions) for Laravel’s core framework services. It collects PHP interfaces for the container, cache, queue, mail, filesystem, events, validation, routing, session, and many other subsystems into a single, dependency-light package with a PSR-4 autoloaded Illuminate\Contracts namespace.

By depending on these interfaces instead of concrete implementations, packages and applications can type-hint against stable abstractions, swap implementations, and keep coupling to the framework low. It is a read-only subtree split of the main laravel/framework repository, published so libraries can require just the contracts without pulling in the entire framework.

What You Get

  • Interfaces for Laravel’s core services (container, cache, queue, mail, filesystem, events, and more)
  • A single PSR-4 namespace (Illuminate\Contracts) covering every framework subsystem
  • A lightweight dependency (PSR container and PSR simple-cache) usable without the full framework
  • Contracts that align with the corresponding Illuminate component implementations
  • A stable abstraction layer for building framework-agnostic Laravel packages

Common Use Cases

  • Type-hinting against Laravel service interfaces in first- or third-party packages
  • Building packages that depend on Laravel abstractions without requiring the whole framework
  • Swapping or decorating concrete implementations behind their contracts

Under The Hood

Architecture - The package is a flat collection of PHP interfaces organized by subsystem directory (Container, Cache, Queue, Mail, Filesystem, Events, Validation, Routing, Session, and roughly thirty more), each declaring the public surface of a Laravel component under the Illuminate\Contracts namespace. It contains only interfaces and a few exception classes, no implementations. Tech Stack - Pure PHP (^8.3), PSR-4 autoloaded, depending only on psr/container and psr/simple-cache; it is a read-only subtree split of laravel/framework. Code Quality - As an interface-only package there is no runtime logic to test; quality shows in thorough PHPDoc, generics annotations (template/class-string), and alignment with PSR standards where applicable (the Container contract extends PSR-11). API Design - The contracts are cleanly namespaced by domain and mirror their implementations, so consumers can discover the right interface intuitively and depend on a narrow, stable abstraction.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search