consolidation/filter-via-dot-access-data
Filter nested PHP arrays with concise dot-access paths. This lightweight package lets you query config-like data using readable dotted keys, simplifying conditional filtering and value lookup in Laravel or plain PHP projects without verbose array access. Ideal for configuration, request data, and ne...
--fields=id,name,user.profile.email and simple key-path filtering of nested output. This directly supports decisions like "do we let CI/ops users select columns in our CLI reports?" without building a bespoke selector per command.--fields work differently here?" support load.Adopt when:
--fields/--filter semantics with near-zero integration cost.Look elsewhere when:
>, contains, regex), boolean composition, sorting semantics, or joins — use a query layer, a Collection pipeline, or a real filter expression parser.NOASSERTION; legal review is required before shipping. It is very likely permissive, but "likely" is not a clearance.data_get() and Arr::get() already do dot-notation lookup. Reimplementing the wrapper is roughly 50 lines and removes the dependency, the license question, and the abandonment risk in one move.Default recommendation: reimplement in-house unless the Consolidation ecosystem is already load-bearing.
To executives: This is a small, low-cost utility that standardizes how our command-line tools let users pick and filter output. It removes duplicated custom flag logic and a recurring category of support requests. It is commodity plumbing, not a competitive feature — the relevant risks are maintenance and licensing, not capability, and both are contained.
To engineering: A thin wrapper over dflydev/dot-access-data exposing dot-path selection on nested arrays. Vendor it behind an internal adapter interface so it can be swapped for Laravel's data_get/Arr or a fork without touching call sites. Before adoption: pin the version, resolve the NOASSERTION license (read the actual license file in the repo), and add a smoke test across the PHP versions we support — the 2019 release predates our current runtime and that needs verification, not assumption.
Bottom line: safe as an internal convenience, wrong as a foundation. The build cost is low enough that owning the ~50 lines is usually the better PM call.
How can I help you explore Laravel packages today?