Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
danilopolani authored Feb 26, 2021
1 parent 23c2808 commit 47f0fbc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ $post = [

dump($tags); // ['foo', 'bar']
dump($gallery); // [['image' => 'image.jpg'], ['image' => 'image2.jpg']]
dump($article) // ['title' => 'Article 1', 'slug' => 'article-1', ...] without tags and gallery
dump($article) // ['title' => 'Article 1', 'slug' => 'article-1', 'description' => 'Lorem ipsum']
```

Destructuring with multiple grouped keys
Expand All @@ -107,7 +107,7 @@ $post = [

dump($slug); // article-1
dump($meta); // ['tags' => ['foo', 'bar'], 'gallery' => ['image' => 'image.jpg'], ['image' => 'image2.jpg']]
dump($article) // ['title' => 'Article 1', 'slug' => 'article-1', ...] without slug, tags and gallery
dump($article) // ['title' => 'Article 1', 'description' => 'Lorem ipsum']

[$notFoundGroup, $article] = Arr::destructure($post, [['notFound1', 'notFound2']]);

Expand Down

0 comments on commit 47f0fbc

Please sign in to comment.