forked from laravel/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -498,7 +498,7 @@ The `diffAssoc` method compares the collection against another collection or a p | |
$collection = collect([ | ||
'color' => 'orange', | ||
'type' => 'fruit', | ||
'remain' => 6 | ||
'remain' => 6, | ||
]); | ||
|
||
$diff = $collection->diffAssoc([ | ||
|
@@ -765,7 +765,7 @@ You may optionally pass the function a "depth" argument: | |
['name' => 'iPhone 6S', 'brand' => 'Apple'], | ||
], | ||
'Samsung' => [ | ||
['name' => 'Galaxy S7', 'brand' => 'Samsung'] | ||
['name' => 'Galaxy S7', 'brand' => 'Samsung'], | ||
], | ||
]); | ||
|
||
|
@@ -998,11 +998,11 @@ The `intersect` method removes any values from the original collection that are | |
The `intersectByKeys` method removes any keys from the original collection that are not present in the given `array` or collection: | ||
|
||
$collection = collect([ | ||
'serial' => 'UX301', 'type' => 'screen', 'year' => 2009 | ||
'serial' => 'UX301', 'type' => 'screen', 'year' => 2009, | ||
]); | ||
|
||
$intersect = $collection->intersectByKeys([ | ||
'reference' => 'UX404', 'type' => 'tab', 'year' => 2011 | ||
'reference' => 'UX404', 'type' => 'tab', 'year' => 2011, | ||
]); | ||
|
||
$intersect->all(); | ||
|
@@ -1224,12 +1224,12 @@ The `mapWithKeys` method iterates through the collection and passes each value t | |
[ | ||
'name' => 'John', | ||
'department' => 'Sales', | ||
'email' => '[email protected]' | ||
'email' => '[email protected]', | ||
], | ||
[ | ||
'name' => 'Jane', | ||
'department' => 'Marketing', | ||
'email' => '[email protected]' | ||
'email' => '[email protected]', | ||
] | ||
]); | ||
|
||
|
@@ -2268,7 +2268,7 @@ The `values` method returns a new collection with the keys reset to consecutive | |
|
||
$collection = collect([ | ||
10 => ['product' => 'Desk', 'price' => 200], | ||
11 => ['product' => 'Desk', 'price' => 200] | ||
11 => ['product' => 'Desk', 'price' => 200], | ||
]); | ||
|
||
$values = $collection->values(); | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -677,14 +677,14 @@ You may even insert several records into the table with a single call to `insert | |
|
||
DB::table('users')->insert([ | ||
['email' => '[email protected]', 'votes' => 0], | ||
['email' => '[email protected]', 'votes' => 0] | ||
['email' => '[email protected]', 'votes' => 0], | ||
]); | ||
|
||
The `insertOrIgnore` method will ignore duplicate record errors while inserting records into the database: | ||
|
||
DB::table('users')->insertOrIgnore([ | ||
['id' => 1, 'email' => '[email protected]'], | ||
['id' => 2, 'email' => '[email protected]'] | ||
['id' => 2, 'email' => '[email protected]'], | ||
]); | ||
|
||
#### Auto-Incrementing IDs | ||
|
This file contains 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
This file contains 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