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
Array Undot

Array Undot Laravel Package

divineomega/array_undot

array_undot expands dot-notation keys back into nested PHP arrays, the inverse of Laravel’s array_dot helper. Turn ['user.name' => 'Jane'] into ['user' => ['name' => 'Jane']] for configs, form data, and validation. Lightweight with a simple API.

View on GitHub
Deep Wiki
Context7

array_undot (the opposite of the array_dot helper function) expands a dot notation array into a full multi-dimensional array.

Frequently asked questions about Array Undot
What does divineomega/array_undot actually do?
It performs the inverse of Laravel's array_dot and Arr::dot helpers by expanding a single-level array with dot-notation keys into a nested multi-dimensional array. For example, ['user.name' => 'Jane'] becomes ['user' => ['name' => 'Jane']]. It is a single-purpose, pure-data transformation utility with no I/O, persistence, service dependencies, or runtime configuration surface.
How do I install array_undot in a Laravel project?
Install it with Composer using composer require divineomega/array_undot. In most cases no service provider is needed because it is a leaf utility rather than a framework component. Check the package's composer.json for autoload.files, since the author's common pattern is to register a global array_undot() function; a global helper could collide with Laravel or another dependency, so verify before adoption.
Does Laravel already have an array_undot function built in?
Yes. Laravel shipped Arr::undot() natively in version 5.8 in 2019. If your application is on Laravel 5.8 or newer, the first-party helper provides the same core flat-to-nested behaviour with zero third-party supply-chain overhead. That fact should dominate the decision unless you have non-Laravel consumers or a legacy framework constraint.
Is array_undot compatible with my Laravel version?
Mechanically it is a small Composer package, so it can be installed in many Laravel projects, but you should check its composer.json constraints for supported PHP and framework versions. The bigger compatibility question is strategic: Laravel 5.8 and later already include Arr::undot(), so the package adds little for modern stacks. It is effectively a single-maintainer package, so do not assume guaranteed compatibility with future PHP majors.
What happens when dot-notation keys collide, such as 'a' and 'a.b'?
Dot notation is inherently lossy, and partial-path collisions such as 'a' => 'x' alongside 'a.b' => 'y' require a defined policy. The likely behaviour is silent last-write-wins overwrite, which is dangerous because it can corrupt data without raising an error. Verify the package's semantics against your exact inputs before relying on it in production.
How does array_undot handle numeric segments like items.0.name?
Numeric segments are expanded into nested PHP arrays, but whether 'items.0.name' produces a list-like structure or a string-keyed array matters for downstream JSON serialization. Consumers that distinguish [] from {} can behave differently depending on the resulting keys. Test representative payloads and inspect the json_encode output before adopting it at an API boundary.
Can I use array_undot for user-controlled request payloads or imported config?
Only with validation and a clear key policy. If input is user-controlled, ambiguous dotted literal keys, empty segments, leading or trailing dots, and silent overwrites become input-validation concerns. Define how collisions are handled and reject malformed keys before expansion. If you are on Laravel 5.8 or newer, native Arr::undot() avoids adding a third-party link for this logic.
What license does array_undot use, and is it safe for commercial projects?
The package is LGPL-3.0, which is a genuine outlier in the PHP ecosystem where MIT dominates. Internal, non-distributed use is normally acceptable, but redistributed SDKs, on-prem appliances, or packaged products may trigger legal review and could require shipping the library's source and modification notices. Treat this as a procurement question, not a code problem, and confirm with legal before shipping.
Is divineomega/array_undot actively maintained?
It is effectively a single-maintainer package with around 24 stars, so assume no SLA, no formal security response process, and no guaranteed compatibility with future PHP majors. For a low-risk leaf utility that may be tolerable, but it still adds a supply-chain link. Pinning the version and monitoring the repository is sensible if you adopt it.
What are the best alternatives to array_undot?
For Laravel 5.8 and newer, use the native Arr::undot() helper first because it is first-party and framework-maintained. For non-Laravel PHP consumers or custom collision semantics, a small internal recursive helper of roughly 15 lines may be simpler and avoids license and supply-chain overhead. Choose the package only if it provides a concrete benefit over those options.
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