Skip to main content

Extension Registries

Register types and namespace roots in a service provider's register() phase, before the kernel discovers extensions.

use JobMetric\Extension\Facades\ExtensionNamespaceRegistry;
use JobMetric\Extension\Facades\ExtensionTypeRegistry;

ExtensionNamespaceRegistry::register('Acme\Reporting\Extensions');
ExtensionTypeRegistry::register('Report', ['label' => 'Reports']);

The namespace must be Composer-autoloadable for discovery to resolve its directory. The default application root is App\Extensions when your Laravel app uses the App namespace.

ExtensionRegistry contains discovered entries. Use byType($type) to list a type, byTypeAndName($type, $name, $owner) for an identity lookup, and owner($namespace) to find a composed entry's immediate owner.