loophp/service-alias-autoregister-bundle
Symfony bundle that automatically registers service aliases, reducing manual container configuration. It helps keep dependency injection clean by wiring aliases based on implemented interfaces and class relationships.
composer require loophp/service-alias-autoregister-bundle. Despite the "Laravel developer" framing, this is a Symfony bundle — it hooks into Symfony's DI container via a compiler pass. In Laravel you'd only benefit from it if you're running Symfony's DI component inside your app (rare); the day-to-day Laravel equivalent is $this->app->bind(Interface::class, Impl::class) in a service provider.composer.json (PHP constraint and Symfony version range), the bundle's DependencyInjection/Configuration.php for the exact config keys, and the compiler pass class — that's where the aliasing logic lives.config/bundles.php (Symfony) and, if you insist on using it under Laravel, wire it through a small service provider that boots the bundle's container extension against a Symfony ContainerBuilder — do not expect Laravel's container to be touched.class FileLogger implements LoggerInterface, let it be autoconfigured, and the bundle creates LoggerInterface → FileLogger aliases for you, so public function __construct(LoggerInterface $logger) autowires without any manual services.yaml alias entry.bin/console debug:container --show-private and confirm the aliases you expected appear. If they don't, nothing downstream will work.Interface → Implementation alias. This keeps services.yaml free of alias boilerplate as the codebase grows.test.service_container in Symfony so aliases stay visible to the test container.ServiceProvider with explicit bind() calls. Duplicating the mapping in two places is annoying but far cheaper than trying to run a Symfony compiler pass inside Laravel's container.cache:clear / cache:warmup) as part of the release, not just composer install — otherwise a stale container silently serves the old alias map.debug:container <Interface> and be explicit when ambiguity is intentional.bin/console debug:autowiring to see what the container thinks it can inject, debug:container --deprecations, and lint:container to catch alias-to-abstract-class mismatches.chore(deps) bump (actions/stale, setup-php, actions/cache, actions/checkout, Renovate config) plus commits labelled ci:, cs:, tests:. There is no functional change, no new config key, no deprecation. Upgrading is low risk.refactor: modernize code and refactor: switch to phpunit 10 commits occasionally ride along with a minimum-PHP bump in composer.json. PHPUnit 10 implies PHP 8.1+ for the test suite; confirm the library's own require.php before rolling this onto an older runtime.composer.json — the passing CI on this release may not exercise your version.How can I help you explore Laravel packages today?