Interface LaravelUi5\Sdk\Intent\Contracts\IntentInterface

Represents a concrete, user- or system-initiated intent.


Mental model

An Intent expresses what is wanted — not how it is executed, not whether it is allowed, and not how it is routed.

Intent = Identity + Parameters

  • Identity → What kind of intent is this?
  • Parameters → What concrete data does this invocation carry?

Intents are the central language between:

  • UI components (CmdK, Navigation, Buttons)
  • Authorization
  • Dispatching
  • Backend execution

Design principles

  • Intents are immutable value objects.
  • Intents are declarative, not procedural.
  • Intents carry no execution logic.
  • Intents carry no authorization logic.
  • Intents carry no routing or transport knowledge.

All behavior is delegated to:

  • IntentHandlers (execution)
  • IntentAuthorizers (authorization)
  • IntentDispatcher (coordination)

Static vs instance data

Static methods describe the kind of intent:

  • name()

Instance data (via constructor) describes the concrete invocation:

  • e.g. which report, which user, which partner

Serialization

Intents must be serializable into a primitive payload so they can be:

  • transported via IntentResults
  • re-dispatched after reloads
  • logged or inspected

Strong typing is encouraged via readonly constructor properties.


Example

final class OpenReportIntent implements IntentInterface { public function __construct( public readonly string $report ) {}

public static function name(): string { return 'report.open'; }

public function parameters(): array { return ['report' => $this->report]; } }

Methods