Interface Ui5RegistryInterface
Build-time registry and introspection contract for the LaravelUi5 Core.
The Ui5Registry is the authoritative source of truth for all UI5-related
artifacts declared in a Laravel application. It is responsible for
discovering, instantiating, and indexing UI5 modules and artifacts
based on configuration and PHP attributes.
The registry operates exclusively at build time (or during application
bootstrapping) and is intentionally reflection-heavy. Its primary purpose
is to provide normalized, deterministic metadata for:
- runtime cache generation
- manifest and resource root assembly
- documentation and inspection tooling
The registry does NOT:
- perform authorization
- interpret semantic meaning
- resolve user intents
- make runtime decisions
In Core 2.0, the registry is strictly technical and URI-oriented.
Semantic concerns (navigation meaning, intent declaration, authorization)
are explicitly handled by the SDK layer.
Responsibilities:
- Discover UI5 modules from configuration
- Discover UI5 artifacts via module registration
- Guarantee uniqueness of module and artifact namespaces
- Provide deterministic lookup structures for cache generation
System guarantees:
- Each module has exactly one unique namespace
- Each artifact has a globally unique namespace
- Artifact type (app, lib, action, report, …) is stable and deterministic
Typical consumers:
- ui5:cache command
- build-time manifest generators
- tooling and diagnostics
| Methods |
public
|
modules(): array<string, Ui5ModuleInterface>
Returns all registered modules.
Returns all registered modules.
|
#
|
public
|
getModule(string $namespace): Ui5ModuleInterface|null
Returns the module instance for the given namespace, or null if not found.
Returns the module instance for the given namespace, or null if not found.
Modules are indexed by the namespace they declare — there is no slug or
short name. config/ui5.php > modules is a plain list of module classes;
nothing in it acts as a lookup key.
Parameters
| $namespace |
The fqn of the UI5 module
|
Returns
The instantiated module, or null if not found
|
#
|
public
|
getModuleByClass(class-string<Ui5ModuleInterface> $class): Ui5ModuleInterface
Returns the registered module instance for the given class name.
Returns the registered module instance for the given class name.
Throws
LogicException |
if the given module class
is not registered in this registry.
|
|
#
|
public
|
artifacts(): array<string, Ui5ArtifactInterface>
Returns all registered artifacts across all modules.
Returns all registered artifacts across all modules.
|
#
|
public
|
getArtifact(string $namespace): Ui5ArtifactInterface|null
Returns the artifact instance for the given namespace, or null if not found.
Returns the artifact instance for the given namespace, or null if not found.
Parameters
| $namespace |
The fqn of the UI5 artifact
|
Returns
The instantiated artifact, or null if not found
|
#
|
public
|
getArtifactByClass(class-string<Ui5ArtifactInterface> $class): Ui5ArtifactInterface
Returns the registered artifact instance for the given class name.
Returns the registered artifact instance for the given class name.
Throws
LogicException |
if the given artifact class
is not registered in this registry.
|
|
#
|
public
|
settings(string|null $namespace = null): array
Returns all settings declared via #[Setting] attributes,
grouped by artifact namespace.
Returns all settings declared via #[Setting] attributes,
grouped by artifact namespace.
- When
$namespace is provided, only settings belonging to
that namespace are returned.
- When
$namespace is null, all settings across all registered
artifacts are returned.
The result reflects the normalized internal structure:
$settings[$namespace][$settingKey] — a plain array per setting, not the
attribute instance, carrying default, type, scope, level, note
and model.
Example:
$registry->settings('io.pragmatiqu.dashboard');
// → [ 'refreshInterval' => ['default' => 60, 'type' => …, …], … ]
Parameters
| $namespace |
Optional artifact namespace to filter by.
|
|
#
|
public
|
pathToNamespace(string $path): string
Converts external URI path segments to canonical registry namespace.
Converts external URI path segments to canonical registry namespace.
Example:
- "io/pragmatiqu/partners" → "io.pragmatiqu.partners"
This method centralizes URI-to-registry normalization logic and
avoids scattering string transformation rules across the codebase.
|
#
|
public
|
namespaceToPath(string $namespace): string
Converts canonical registry namespace to external URI path segments.
Converts canonical registry namespace to external URI path segments.
Example:
- "io.pragmatiqu.partners" → "io/pragmatiqu/partners"
This method centralizes registry-to-URI normalization logic and
avoids scattering string transformation rules across the codebase.
|
#
|
public
|
resolve(string $namespace): string|null
Resolves a full public URL path for the given namespace
(e.g. "/ui5/app/io/pragmatiqu/offers@1.0.0").
Resolves a full public URL path for the given namespace
(e.g. "/ui5/app/io/pragmatiqu/offers@1.0.0").
Parameters
| $namespace |
The fqn of the UI5 artifact
|
Returns
The absolute path, or null if not found
|
#
|
public
|
resolveManifestUrl(string $namespace): string
Resolves the absolute manifest URL for the given namespace
(i.e. the {@see resolve()} base with `/manifest.json`…
Resolves the absolute manifest URL for the given namespace
(i.e. the {@see resolve()} base with /manifest.json appended,
e.g. "/ui5/dashboard/io/pragmatiqu/portal@1.0.0/manifest.json").
Unlike {@see resolve()} this is strict: a missing artifact is a
programming error, not a nullable miss.
Parameters
| $namespace |
The fqn of the UI5 artifact
|
Throws
|
#
|
public
|
resolveIndexUrl(string $namespace, string|null $segment = null): string
Resolves the App index URL for the given namespace
(the {@see resolve()} base with `/index.html` appended) and,
when a…
Resolves the App index URL for the given namespace
(the {@see resolve()} base with /index.html appended) and,
when a non-empty $segment is given, a #/{segment} client
route on top of it. A null/empty segment yields the bare
/index.html; a '/' segment yields /index.html#/.
App-only: the namespace must resolve to an Application artifact.
Parameters
| $namespace |
The fqn of the UI5 artifact (App)
|
| $segment |
a client route
|
Throws
|
#
|
public
|
resolveRoots(array<int, string> $namespaces): array<string, string>
Resolves resource root URLs (namespace => URL) for multiple namespaces.
Resolves resource root URLs (namespace => URL) for multiple namespaces.
Parameters
| $namespaces |
The fqn of the UI5 artifact (app or lib!)
|
|
#
|
public
|
hasSlot(string $name): bool
Whether the slot catalog has an entry for $name.
Whether the slot catalog has an entry for $name.
Parameters
| $name |
canonical slot name (matches ^[a-z][a-zA-Z0-9_]*$)
|
|
#
|
public
|
getSlot(string $name): SlotCatalogEntry
Returns the catalog row for $name.
Returns the catalog row for $name.
Throws
|
#
|
public
|
getAllSlots(): array<string, SlotCatalogEntry>
Returns the entire slot catalog keyed by slot name.
Returns the entire slot catalog keyed by slot name.
|
#
|