Skip to content

Commit

Permalink
add method to data_fetch get data using dot notation data_get() repro…
Browse files Browse the repository at this point in the history
…duce issue in some case
  • Loading branch information
aqibmehmmod committed Aug 6, 2024
1 parent f6605bb commit 5f66822
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Illuminate/Collections/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ function data_get($target, $key, $default = null)
return $target;
}
}
/**
* Get an item from an array or object using "dot" notation.
*
* @param mixed $target
* @param string|array|int|null $key
* @param mixed $default
* @return mixed
*/
function data_fetch(mixed $target, string|array|int|null $key, mixed $default = null, bool $trim = false): mixed
{
if (is_null($key)) {
Expand Down

0 comments on commit 5f66822

Please sign in to comment.