sajadsdi/array-dot-notation
Lightweight, high-performance PHP helper to get, set, delete, and check nested array values using dot notation. Supports multi-key operations, default values, key mapping on output, and callbacks for get/set behavior.
Arr helper but offers a lightweight, dependency-free alternative. No breaking changes to Laravel compatibility.Arr::dot() is overkill.Arr helper.set()/get() with complex paths).set('a.b', 'x') vs. set('a', ['b' => 'x'])).Arr::dot().null values, mixed key types) addressed in the refactor?1.0.5 maintain 100% API compatibility with prior versions? Test with existing code.Arr helper (for Laravel-specific features like Arr::dot()).Yaml parsing).1.0.5 in a sandbox with:
1.0.4 and Laravel’s Arr::dot()).explode('.', $key)).Arr, document usage guidelines (e.g., prefer Arr::dot() for Laravel features, use this package for lightweight needs).1.0.5 introduces public API changes (e.g., new methods). If not, compatibility remains unchanged.composer update sajadsdi/array-dot-notation --with-dependencies
set()/get() with nested arrays).$value = ArrayDot::get(request()->all(), 'user.address.city');
ArrayDot::set(config('services'), 'stripe.api_key', env('STRIPE_KEY'));
1.0.5 optimizations (if any).set('a.b', 'x') vs. set('a', ['b' => 'x'])).dd() or var_dump() to inspect array structures.ArrayDot::set() calls).1.0.5 likely improves speed for recursive operations, but benchmark for:
a..b).^\w+(?:[\.\w]+)*$).function immutableSet(array $array, string $path, $value): array {
$newArray = $array;
ArrayDot::set($newArray, $path, $value);
return $newArray;
}
null values).NO_UPDATE_NEEDED would not apply here due to the refactor’s potential impact on performance and edge cases. The above is the updated assessment reflecting 1.0.5.
How can I help you explore Laravel packages today?