gcego/registry
gcego/registry is a lightweight Laravel package that provides a simple registry for registering, resolving, and managing shared values, services, and configuration through a clean, fluent API, helping centralize reusable objects and app bindings.
The v1.1.0 release is a stability and ergonomics release for a Laravel/PHP definition-discovery and registry package. It addresses the highest-risk area for TPM adoption: class-declaring definition files interacting with Composer autoloading, registry refreshes, cache rebuilds, and long-running PHP processes such as queue workers and Octane. The package appears to fit Laravel applications that need modular definition/provider discovery with caching, but the class-declaring path introduces lifecycle-sensitive behavior that must be validated in the target runtime.
Architecture fit is strongest where the application already uses Laravel service providers, package discovery, and cache rebuild commands, and where definitions are organized into registered roots. The new class entrypoint shorthand (return Foo::class; may be omitted when a file declares exactly one DefinitionProvider) simplifies authoring but increases implicit behavior. The new DiscoveredFile::$alternatives, withAlternative(), and roots() APIs improve observability for files reachable through multiple roots, especially when packages share folders.
Integration feasibility is moderate. The release fixes fatal “cannot declare class” errors across refresh, cache rebuild, cache verification, cache resolution, and Composer-autoloaded files, which lowers integration risk. However, the deliberate DefinitionLoadException when a class-declaring entrypoint changes after load in Octane or queue workers means deployment and restart procedures must be explicit. The “declared by two entrypoints” exception is safer than a fatal error but still requires operational handling.
Technical risk is concentrated in class-loading semantics, cache coherence, and long-running process restarts. Files that declare no classes behave exactly as before, so existing non-class definitions are low risk. Class-declaring definitions, multiple roots, and class entrypoints need targeted testing. The release notes do not indicate breaking changes or deprecations.
Key questions:
DefinitionProvider contract and root-registration API?roots() expose enough information to debug shared-folder ownership?Stack fit is good for Laravel applications using service providers, package discovery, and cached configuration/bootstrap data. The package should be introduced first in a non-critical environment or a bounded module, then expanded after validating cache rebuilds, worker restarts, and Octane behavior. The release is additive and bug-fix oriented, so a full replacement migration is not implied; teams can adopt class entrypoints incrementally while leaving existing definition files unchanged.
Migration path:
DefinitionProvider before adopting the shorthand entrypoint.Compatibility considerations: Composer-autoloaded classes are now explicitly handled, which reduces conflicts with existing autoload configuration. The new exception paths must be caught or surfaced in deployment tooling. Files without classes are explicitly backward compatible, so the risk is isolated to class-declaring definitions and long-running processes.
Sequencing should be: local validation, CI cache verification, staging with Octane/queue workers, production canary, then broader adoption. Do not combine this upgrade with unrelated discovery or autoload changes; isolate the package version change so DefinitionLoadException behavior can be attributed clearly.
Maintenance impact is moderate. The release reduces fatal-error support burden but introduces explicit exceptions that must be documented. Teams need a runbook for DefinitionLoadException: identify the changed class-declaring entrypoint, restart workers/Octane, rebuild cache, and verify resolution. The new alternatives and roots() APIs help debugging shared-folder ownership but also expand the surface area that support engineers must understand.
Support impact: first-line support should know that class-declaring definition changes are not hot-reloadable in long-running processes. The exception asking for a restart is intentional and safer than serving stale classes, but it will appear as a deployment or runtime failure if restarts are missed. Duplicate class declarations across entrypoints should be treated as configuration errors, not runtime faults.
Scaling impact is likely positive because cache rebuild and verification no longer fatal on duplicate inclusion. However, large root sets and shared folders can produce alternatives that need deterministic resolution. Validate cache size, rebuild time, and memory use in staging. The package should scale with Laravel’s existing cache and bootstrap patterns, but class-declaring entries must remain stable between restarts.
Failure modes:
DefinitionLoadException after a class-declaring entrypoint changes in a queue worker or Octane process.DefinitionLoadException when two entrypoints declare the same class.Ramp-up is low for teams already familiar with Laravel providers and cache commands, and moderate for teams operating Octane or queue workers that require coordinated restarts. TPM leverage is highest by using this release to standardize definition discovery, add cache-verification gates to CI, and make worker/Octane restarts part of the deployment checklist.
How can I help you explore Laravel packages today?