Class LaravelUi5\Core\Contracts\Ui5Bag

abstract
readonly

Immutable key-value bag with typed accessors.

This base class is used for both Ui5Args (runtime parameters) and Ui5Config (resolved settings). It assumes that all values have already been validated and cast by the respective Resolver.

Responsibilities:

  • Provide read-only access to the underlying data array.
  • Offer typed getter methods with default values.
  • Keep logic minimal: no additional casting or validation.

Example:

$args = new Ui5Args(['year' => 2025, 'active' => true]);
$year = $args->int('year');           // 2025
$active = $args->bool('active');      // true
$missing = $args->string('foo', 'x'); // "x"
Methods