diff --git a/src/flextype/Support/Macros/Arrays.php b/src/flextype/Support/Macros/Arrays.php new file mode 100644 index 00000000..57ea1a21 --- /dev/null +++ b/src/flextype/Support/Macros/Arrays.php @@ -0,0 +1,39 @@ +toArray() as $key => $value) { + $result[$key] = arrays($value)->only($keys)->toArray(); + } + + return arrays($result); +}); + +Arrays::macro('exceptFromCollection', function(array $keys) { + $result = []; + + foreach ($this->toArray() as $key => $value) { + $result[$key] = arrays($value)->except($keys)->toArray(); + } + + return arrays($result); +}); \ No newline at end of file