apie/service-provider-generator
Generate Laravel ServiceProvider classes from Symfony YAML service definitions. Keep framework-agnostic libraries in sync by maintaining a single service container registry, then output PHP source code you can write to a file (or eval if you must).
services.yaml configuration, addressing a niche but critical need for teams migrating from Symfony or adopting hybrid architectures.services.yaml; Laravel’s native app/Providers/ or config/services.php may suffice.bindIf, when) may require manual overrides.App\Providers\*ServiceProvider), which integrate seamlessly into Laravel’s bootstrapping.config/services.php or app/Providers/AppServiceProvider.yaml and dependency-injection components (likely auto-loaded via Composer).tags, decorators, arguments, or public flags to Laravel equivalents (e.g., Laravel lacks native decorator support).services.yaml may define circular references, which Laravel’s container handles differently (e.g., AbstractLazyServiceProvider vs. Symfony’s circular_reference handling).autowire: true vs. Laravel’s bind()/singleton()?argument_on_instantiate or factory?bindIf, when, or context binding?Http, Cache) handled if referenced in services.yaml?AppServiceProvider?services.yaml per environment) managed?Illuminate\Contracts\Container\Container extensions.AppServiceProvider.yaml and dependency-injection components (v6+ likely, given 2025 release).composer require apie/service-provider-generator.make:service-provider or apie:generate command.services.yaml for Laravel-incompatible features (e.g., decorators, tags).config/services.php, AppServiceProvider).app()->make() and dependency injection.when, bindIf).| Feature | Laravel Equivalent | Risk |
|---|---|---|
autowire: true |
Laravel’s autowiring (partial) | May require manual binding |
tags |
Laravel’s tag() method |
Limited use in Laravel |
decorators |
No native support | Manual wrapper classes needed |
arguments |
Constructor injection | Full support |
public: false |
Laravel’s private services | Supported via private: true |
Cache::get()) may need explicit binding.when() or bindIf() cannot be auto-generated from YAML.services.yaml (e.g., avoid Symfony-specific features).services.yaml files (e.g., php artisan apie:generate).app/Providers/ (follow Laravel conventions).AppServiceProvider (e.g., combine bind() calls).config/app.php to register new providers in the correct boot order.services.yaml remains the single source of truth for DI.register()/boot() methods in custom providers to extend generated ones.app()->bindings or app()->has() to inspect bindings.AppServiceProvider and migrate others incrementally.README or CONTRIBUTING.md.How can I help you explore Laravel packages today?