Class LaravelUi5\Core\Http\Middleware\ResolveUi5Context

readonly

Middleware: ResolveUi5Context

This middleware inspects incoming requests and attaches a Ui5Context object to the service container if the request path belongs to a UI5 artifact.

Responsibilities:

  • Detect if the request path is under the configured UI5 route prefix.
  • Derive the urlKey via ArtifactType::urlKeyFromPath().
  • Lookup the matching artifact in the Ui5Registry.
  • Build a Ui5Context (request, artifact, locale).

Behavior:

  • If no artifact is matched → {@see MissingArtifactException}.
  • If an artifact is matched but not found in the registry → {@see MissingArtifactException}.

The resolved Ui5Context can be injected anywhere downstream via type-hinting or app(Ui5Context::class).

Methods