rybakit/arguments-resolver
Lightweight PHP library that resolves callable arguments via reflection, matching values from arrays or containers to parameter types, names, and defaults. Automatically fills optional parameters and helps build invokers or small DI containers. Works with closures, functions, methods, and invokable...
{ "handler": "...", "inputs": {...} }, you need name/type-based binding from the inputs map to the handler signature. That is exactly this problem, and it is not the same problem Laravel's container solves.app()->call() / Container::call() plus route model binding, which covers controller, listener, job, and command injection. Adopt this package only for the slice where arguments come from an arbitrary value map rather than the service container — or when a framework-agnostic package must not depend on Laravel.Consider it when all of the following hold:
Look elsewhere when:
app()->call(), route model binding, and contextual binding. Adding a package here is pure duplication.For executives: This is a small, MIT-licensed utility that solves one specific problem — passing the right arguments to a function we didn't write. It unblocks the extensibility story (customer-defined handlers, automation steps) without a platform commitment. The cost is a one-week spike plus a thin internal wrapper; the risk is staleness, not licensing or lock-in, and it is fully mitigated by forking or swapping in Laravel's built-in mechanism. Frame it as "we adopted ~200 lines of proven logic," not "we added a dependency."
For engineering: Wrap it behind our own ArgumentResolver interface from day one, with the Laravel container implementation as the default and this package as the fallback for context-map resolution. The spike must prove: PHP 8 union/intersection types, variadics, default and optional parameters, nullable handling, and named-argument behavior; plus a micro-benchmark of reflection cost with and without caching resolved signatures. If any of those fail, we fork — the license permits it and the surface is small enough to own. Either way, no call site should reference the package directly, so the decision stays reversible.
How can I help you explore Laravel packages today?