Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Binding Bundle Laravel Package

sonofwinter/binding-bundle

A small Laravel/PHP package for organizing and registering service container bindings as reusable bundles. It helps keep dependency injection setup tidy by grouping related bindings and simplifying provider registration.

View on GitHub
Deep Wiki
Context7

Getting Started

Before anything else: this is a Symfony bundle, not a Laravel package. composer require sonofwinter/binding-bundle will pull it into a Laravel app, but there is no service provider, no facade, and no auto-discovery — Laravel will never boot it. Treat this assessment as "what does it do, and what would I use instead in Laravel."

First steps if you are actually in a Symfony project:

  1. composer require sonofwinter/binding-bundle
  2. Register SonOfWinter\BindingBundle\BindingBundle in config/bundles.php.
  3. Look at the bundle's DependencyInjection/ extension and Resources/config/services.yaml first — that is where the binder service id and any tagged services are declared.
  4. Wire the binder into a controller and pass a validated array + an entity class or instance.

First realistic use case: a controller receives a validated associative array (from a form or JSON payload) and you want it hydrated onto a Doctrine entity without hand-writing setters. In Laravel the direct equivalent is $model->fill($request->validated()) guarded by $fillable, or a DTO hydrator such as spatie/laravel-data.

Implementation Patterns

Symfony-side pattern (where the package is intended to work):

  • Controller → Form/Validator produces a clean array → binder binds array to entity → EntityManager::persist()/flush().
  • Use it as a thin alternative to Symfony's PropertyAccessor + Serializer when you only care about scalar/property mapping and want to avoid serializer metadata overhead.
  • Combine with symfony/validator constraints on the entity so validation runs after binding, not before.

Laravel-side patterns (what you would actually ship):

  • Mass-assignment pattern: Model::create($request->validated()) with strict $fillable (or $guarded = [] only on models you fully trust). This is the closest day-to-day analog.
  • DTO pattern: spatie/laravel-data or a small custom hydrator (new UserData(...$validated)) when you need typed properties and nested objects — this is functionally what the bundle is doing in Symfony.
  • Update pattern: $model->fill($validated)->save() inside a DB::transaction() when the array touches related records.

Cross-framework interop (only if you genuinely need this bundle's behavior in a Laravel shop): expose the Symfony service over HTTP and call it with Http::post(...). Do not attempt to shim Symfony's DI container into Laravel's — it is not worth it for a 3-star, zero-dependent package.

Gotchas and Tips

  • Signal quality is poor. 3 stars, 0 dependents, opportunity score 12.66, overall 0.015. There is effectively no community validation, no downstream usage to copy patterns from, and no guarantee of maintenance. Do not put this on a production path.
  • Composer name vs. repo name. Repo is SonOfWinter/BindingBundle; the package is sonofwinter/binding-bundle. Confirm the composer.json name field before requiring — casing/namespace mismatches are common in low-traffic bundles and will fail autoload silently.
  • Mass-assignment risk. Binding an arbitrary array onto an entity (or model) without a whitelist is the classic vulnerability. In Symfony, guard with explicit property lists or the validator; in Laravel, this maps directly to unguarded fill(). Always pass $request->validated(), never $request->all().
  • No Laravel integration surface. No config publish, no service provider bindings, no facade. Any "integration" is manual instantiation or HTTP.
  • Debugging in Symfony: if the binder service is missing at runtime, run bin/console debug:container | grep -i bind — bundles that fail to register their extension usually silently drop services. Check var/log/dev.log for ServiceNotFoundException rather than assuming a binding bug.
  • Extension points (if the bundle exposes them): look for tagged services such as binding.binder or a compiler pass in DependencyInjection/Compiler/. Custom binders are typically registered via tag; without docs you will need to read the compiler pass source.
  • Migration escape hatch. If you prototype with this bundle and later move to Laravel, replace it with fill() + $fillable, or spatie/laravel-data for typed DTOs. The concepts port cleanly; the code does not.
  • Version pin. If you must use it, pin an exact commit in composer.json — an untagged bundle can change behavior on composer update.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console