# laravel/framework architecture

> Architecture diagram of the GitHub repository laravel/framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/laravel/framework
- Repository: https://github.com/laravel/framework

## Overview

Laravel is a PHP web application framework. An application request enters its routing and middleware pipeline, where the container resolves dependencies and framework services; application code can then use persistence, authentication, views, caching, and other facilities to produce a response. The README also identifies migrations, background jobs, and real-time broadcasting as major capabilities. The map emphasizes those product areas and central runtime abstractions; several subsystem relationships are documented at capability level because their implementation files were not sampled.

Main entry points: [`src/Illuminate/Config/Repository.php`](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Config/Repository.php) (Configuration), [`src/Illuminate/Support/Facades/Facade.php`](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Support/Facades/Facade.php) (Facade access), [`src/Illuminate/Routing/Pipeline.php`](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Routing/Pipeline.php) (Request pipeline), [`src/Illuminate/Container/Attributes/Database.php`](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Container/Attributes/Database.php) (Database injection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Runtime"]
  node_routing["Routing"]
  node_pipeline["Request pipeline<br/>[Pipeline.php]"]
  node_views["View rendering"]
  node_exceptionrenderer["Exception rendering<br/>[Exception.php]"]
end

subgraph group_core["Framework Core"]
  node_container["Dependency container<br/>[Container.php]"]
  node_configuration["Configuration<br/>[Repository.php]"]
  node_facades["Facade access<br/>[Facade.php]"]
  node_pipelinecore["Pipeline primitives<br/>[Pipeline.php]"]
  node_conditionable["Conditional helpers<br/>[Conditionable.php]"]
end

subgraph group_data["Data and Identity"]
  node_database[("Database and migrations")]
  node_dbattribute["Database injection<br/>[Database.php]"]
  node_filesystem["Filesystem<br/>[Filesystem.php]"]
  node_cache[("Cache and sessions")]
  node_authentication["Authentication"]
  node_eloquentattribute["Model attributes<br/>[Attribute.php]"]
end

subgraph group_async["Async Work"]
  node_queues["Background queues"]
  node_bus["Job dispatch<br/>[Bus.php]"]
  node_broadcast["Event broadcasting"]
  node_concurrency["Concurrent execution"]
end

subgraph group_utilities["Application Services"]
  node_httpclient["HTTP client<br/>[Http.php]"]
  node_collections["Collections<br/>[Collection.php]"]
  node_arrays["Array utilities<br/>[Arr.php]"]
  node_macroable["Macro extensions<br/>[Macroable.php]"]
  node_supportcomposer["Support utilities<br/>[Composer.php]"]
  node_traits["Support traits<br/>[Traits.php]"]
end

node_developer(("Application developer"))

node_developer -->|"defines routes"| node_routing
node_routing -.->|"runs middleware"| node_pipeline
node_pipeline -->|"extends"| node_pipelinecore
node_pipeline -.->|"renders exceptions"| node_exceptionrenderer
node_pipelinecore -->|"resolves pipes"| node_container
node_views -->|"uses files"| node_filesystem
node_developer -->|"injects dependencies"| node_container
node_developer -.->|"configures application"| node_configuration
node_developer -->|"runs migrations"| node_database
node_developer -->|"dispatches jobs"| node_queues
node_developer -->|"broadcasts events"| node_broadcast
node_developer -->|"uses cache"| node_cache
node_developer -.->|"authenticates users"| node_authentication
node_developer -.->|"renders views"| node_views
node_dbattribute -->|"resolves through"| node_container
node_dbattribute -->|"requests connection"| node_database
node_bus -.->|"dispatches jobs"| node_queues
node_concurrency -->|"uses utilities"| node_supportcomposer
node_configuration -->|"reads values"| node_arrays
node_configuration -->|"uses collections"| node_collections
node_configuration -->|"uses macros"| node_macroable
node_conditionable -->|"uses trait"| node_traits
node_eloquentattribute -->|"references attribute"| node_dbattribute
node_facades -->|"registers alias"| node_bus
node_facades -->|"registers alias"| node_concurrency
node_facades -->|"resolves facade"| node_httpclient

click node_routing "https://github.com/laravel/framework/tree/13.x/src/Illuminate/Routing"
click node_pipeline "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Routing/Pipeline.php"
click node_views "https://github.com/laravel/framework/tree/13.x/src/Illuminate/View"
click node_container "https://github.com/laravel/framework/blob/13.x/types/Container/Container.php"
click node_configuration "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Config/Repository.php"
click node_facades "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Support/Facades/Facade.php"
click node_pipelinecore "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Pipeline/Pipeline.php"
click node_conditionable "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Conditionable/Traits/Conditionable.php"
click node_database "https://github.com/laravel/framework/tree/13.x/src/Illuminate/Database"
click node_dbattribute "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Container/Attributes/Database.php"
click node_filesystem "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Filesystem/Filesystem.php"
click node_cache "https://github.com/laravel/framework/tree/13.x/src/Illuminate/Cache"
click node_authentication "https://github.com/laravel/framework/tree/13.x/src/Illuminate/Auth"
click node_queues "https://github.com/laravel/framework/tree/13.x/src/Illuminate/Queue"
click node_bus "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Support/Facades/Bus.php"
click node_broadcast "https://github.com/laravel/framework/tree/13.x/src/Illuminate/Broadcasting"
click node_concurrency "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Concurrency/ConcurrencyManager.php"
click node_httpclient "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Support/Facades/Http.php"
click node_collections "https://github.com/laravel/framework/blob/13.x/types/Support/Collection.php"
click node_arrays "https://github.com/laravel/framework/blob/13.x/types/Support/Arr.php"
click node_macroable "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Macroable/Traits/Macroable.php"
click node_supportcomposer "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Support/Composer.php"
click node_exceptionrenderer "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Foundation/Exceptions/Renderer/Exception.php"
click node_eloquentattribute "https://github.com/laravel/framework/blob/13.x/src/Illuminate/Database/Eloquent/Casts/Attribute.php"
click node_traits "https://github.com/laravel/framework/blob/13.x/types/Support/Traits.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routing,node_pipeline,node_views,node_exceptionrenderer toneBlue
class node_container,node_configuration,node_facades,node_pipelinecore,node_conditionable toneAmber
class node_database,node_dbattribute,node_filesystem,node_cache,node_authentication,node_eloquentattribute toneMint
class node_queues,node_bus,node_broadcast,node_concurrency toneRose
class node_httpclient,node_collections,node_arrays,node_macroable,node_supportcomposer,node_traits,node_developer toneIndigo
```

## Components

### Web Runtime

- [Routing](https://github.com/laravel/framework/tree/13.x/src/Illuminate/Routing): `src/Illuminate/Routing`
- [Request pipeline](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Routing/Pipeline.php): `src/Illuminate/Routing/Pipeline.php`
- [View rendering](https://github.com/laravel/framework/tree/13.x/src/Illuminate/View): `src/Illuminate/View`
- [Exception rendering](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Foundation/Exceptions/Renderer/Exception.php): `src/Illuminate/Foundation/Exceptions/Renderer/Exception.php`

### Framework Core

- [Dependency container](https://github.com/laravel/framework/blob/13.x/types/Container/Container.php): `types/Container/Container.php`
- [Configuration](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Config/Repository.php): `src/Illuminate/Config/Repository.php`
- [Facade access](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Support/Facades/Facade.php): `src/Illuminate/Support/Facades/Facade.php`
- [Pipeline primitives](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Pipeline/Pipeline.php): `src/Illuminate/Pipeline/Pipeline.php`
- [Conditional helpers](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Conditionable/Traits/Conditionable.php): `src/Illuminate/Conditionable/Traits/Conditionable.php`

### Data and Identity

- [Database and migrations](https://github.com/laravel/framework/tree/13.x/src/Illuminate/Database): `src/Illuminate/Database`
- [Database injection](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Container/Attributes/Database.php): `src/Illuminate/Container/Attributes/Database.php`
- [Filesystem](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Filesystem/Filesystem.php): `src/Illuminate/Filesystem/Filesystem.php`
- [Cache and sessions](https://github.com/laravel/framework/tree/13.x/src/Illuminate/Cache): `src/Illuminate/Cache`
- [Authentication](https://github.com/laravel/framework/tree/13.x/src/Illuminate/Auth): `src/Illuminate/Auth`
- [Model attributes](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Database/Eloquent/Casts/Attribute.php): `src/Illuminate/Database/Eloquent/Casts/Attribute.php`

### Async Work

- [Background queues](https://github.com/laravel/framework/tree/13.x/src/Illuminate/Queue): `src/Illuminate/Queue`
- [Job dispatch](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Support/Facades/Bus.php): `src/Illuminate/Support/Facades/Bus.php`
- [Event broadcasting](https://github.com/laravel/framework/tree/13.x/src/Illuminate/Broadcasting): `src/Illuminate/Broadcasting`
- [Concurrent execution](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Concurrency/ConcurrencyManager.php): `src/Illuminate/Concurrency/ConcurrencyManager.php`

### Application Services

- [HTTP client](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Support/Facades/Http.php): `src/Illuminate/Support/Facades/Http.php`
- [Collections](https://github.com/laravel/framework/blob/13.x/types/Support/Collection.php): `types/Support/Collection.php`
- [Array utilities](https://github.com/laravel/framework/blob/13.x/types/Support/Arr.php): `types/Support/Arr.php`
- [Macro extensions](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Macroable/Traits/Macroable.php): `src/Illuminate/Macroable/Traits/Macroable.php`
- [Support utilities](https://github.com/laravel/framework/blob/13.x/src/Illuminate/Support/Composer.php): `src/Illuminate/Support/Composer.php`
- [Support traits](https://github.com/laravel/framework/blob/13.x/types/Support/Traits.php): `types/Support/Traits.php`

### Other components

- **Application developer**

## Connections

- Application developer → Routing: defines routes (evidence: `README.md`)
- Routing → Request pipeline: runs middleware (evidence: `src/Illuminate/Routing/Pipeline.php`)
- Request pipeline → Pipeline primitives: extends (evidence: `src/Illuminate/Routing/Pipeline.php`)
- Request pipeline → Exception rendering: renders exceptions
- Pipeline primitives → Dependency container: resolves pipes (evidence: `src/Illuminate/Pipeline/Pipeline.php`)
- View rendering → Filesystem: uses files (evidence: `src/Illuminate/View/Engines/CompilerEngine.php`)
- Application developer → Dependency container: injects dependencies (evidence: `README.md`)
- Application developer → Configuration: configures application
- Application developer → Database and migrations: runs migrations (evidence: `README.md`)
- Application developer → Background queues: dispatches jobs (evidence: `README.md`)
- Application developer → Event broadcasting: broadcasts events (evidence: `README.md`)
- Application developer → Cache and sessions: uses cache (evidence: `README.md`)
- Application developer → Authentication: authenticates users
- Application developer → View rendering: renders views
- Database injection → Dependency container: resolves through (evidence: `src/Illuminate/Container/Attributes/Database.php`)
- Database injection → Database and migrations: requests connection (evidence: `src/Illuminate/Container/Attributes/Database.php`)
- Job dispatch → Background queues: dispatches jobs
- Concurrent execution → Support utilities: uses utilities (evidence: `src/Illuminate/Concurrency/ConcurrencyManager.php`)
- Configuration → Array utilities: reads values (evidence: `src/Illuminate/Config/Repository.php`)
- Configuration → Collections: uses collections (evidence: `src/Illuminate/Config/Repository.php`)
- Configuration → Macro extensions: uses macros (evidence: `src/Illuminate/Config/Repository.php`)
- Conditional helpers → Support traits: uses trait (evidence: `src/Illuminate/Conditionable/Traits/Conditionable.php`)
- Model attributes → Database injection: references attribute (evidence: `src/Illuminate/Database/Eloquent/Casts/Attribute.php`)
- Facade access → Job dispatch: registers alias (evidence: `src/Illuminate/Support/Facades/Facade.php`)
- Facade access → Concurrent execution: registers alias (evidence: `src/Illuminate/Support/Facades/Facade.php`)
- Facade access → HTTP client: resolves facade (evidence: `src/Illuminate/Support/Facades/Http.php`)
