Created
June 22, 2024 05:06
-
-
Save untillnesss/c7bd2e20512ffc39391def8b503e6591 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Collection::macro('recursive', function () { | |
return $this->map(function ($value) { | |
if (is_array($value) || is_object($value)) { | |
return collect($value)->recursive(); | |
} | |
return $value; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment