Added code to return the entire array to Arr::dot.

This commit is contained in:
Taylor Otwell 2011-08-02 13:40:25 -05:00
parent dfbd8e7950
commit db5c61d50c
1 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,11 @@ public static function get($array, $key, $default = null)
*/ */
public static function dot($array, $key, $default = null) public static function dot($array, $key, $default = null)
{ {
if (is_null($key))
{
return $array;
}
foreach (explode('.', $key) as $segment) foreach (explode('.', $key) as $segment)
{ {
if ( ! isset($array[$segment])) if ( ! isset($array[$segment]))