Framework capabilities

Framework features.

The HTTP runtime, routing, dependency injection and CLI form the application foundation. Database, validation, cache, queue and other services are composed through providers and configuration.

Application foundationLemonade FrameworkPHP 8.3–8.5
HTTP layerRequest and response
RoutingRoutes and controllers
ServicesContainer and providers
ConsoleCommands and cron
PSR-7PSR-11PSR-15PSR-17PSR-18
Application foundation

Core framework components

The core covers HTTP request handling, controller dispatch and service registration.

HTTP runtime and routing

The HTTP kernel passes a PSR-7 request through PSR-15 middleware. The router then selects an explicitly mapped controller action.

01RequestPSR-7 ServerRequest
02MiddlewarePSR-15 pipeline
03RouterMethod, URL and parameters
04ControllerDI and action invocation
05ResponsePSR-7 Response

The resulting response travels back through the middleware pipeline, which can still modify it before it is emitted.

Routing documentation

Controllers and views

Controllers are plain PHP classes. The framework creates them in the Request scope and injects their constructor dependencies.

  • ControllerAction::for()
  • Typed route parameters
  • ViewRendererInterface
  • HTML, JSON and other PSR-7 responses
Controller documentation

DI, providers and configuration

Service providers compose services, while typed configuration maps YAML inputs to runtime configuration objects.

  • PSR-11 runtime container
  • Transient, singleton and scoped services
  • ServiceProviderInterface
  • Typed definitions and config cache
Dependency injection documentation
Three runtime contexts

Web, CLI and queues

All entry points use the same provider registration and configuration model. Each execution still creates its own scope and exposes only the values relevant to that context.

Architecture details
HTTP RequestRequest scope

One scope for a specific HTTP request, from middleware through controller dispatch.

ServerRequestInterfaceRouteMatchController
CLI CommandCommand scope

A separate scope for the selected console command and its input and output.

CommandContextCommandInputCommandOutput
Queue JobJob scope

An isolated scope for each message handled through the synchronous or database transport.

JobContextMessage handlerQueue transport
Shared application compositionService definitions and configuration

Providers register definitions once during bootstrap. Each service keeps the transient, singleton or scoped lifetime declared by its registration.

ProvidersConfigurationContainer definitionsModulesLogging
Installation and first application

Get started

The installation chapter covers requirements, Composer installation, application bootstrap and the first working route.

Open the installation guide