Support Custom Separators in data_get, data_set, data_has, and data_forget #58243
Unanswered
Abather
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's a well-written suggestion for Laravel framework:
Feature Request: Custom Separator Support for Data Helper Functions
Summary
Add custom separator support to Laravel's data helper functions (
data_get,data_set,data_has,data_forget) to allow developers to use alternative delimiters beyond the default dot notation.Motivation
Currently, Laravel's data helpers only support dot notation (
.) as a separator. However, there are scenarios where using alternative separators would be beneficial:'first.name','config.value')->) mirrors object property access syntax->in relationships and queries/,:,|)Examples
Current Limitation
Proposed Solution
Proposed Implementation
Function Signatures
Implementation Example for
data_getBenefits
., existing code continues to workUse Cases
Working with External APIs
Impact
Related
This enhancement complements Laravel's existing flexibility with array/object access and would align with the framework's philosophy of developer happiness through intuitive, expressive syntax.
I submit a PR with full implementation and tests.
Beta Was this translation helpful? Give feedback.
All reactions