Nexus API Reference

FromPrincipalResolver
in package
implements ParamResolver

Read onlyYes
FinalYes
Tags
psalm-api

Recognises #[FromPrincipal] and reads the 'principal' request attribute stamped by AuthenticationMiddleware.

Only valid in request-bound scopes (HttpRequest, WsConnection). Throws at compile time if used in HttpBoot — the principal is per-request, not per-handler-instance.

Register via $app->paramResolver(new FromPrincipalResolver()) in the application bootstrap. The same resolver instance serves HTTP and WS handlers automatically.

Table of Contents

Interfaces

ParamResolver

Methods

compile()  : ParamMetadata|null
resolve()  : mixed

Methods


        
On this page

Search results