Skip to content

Commit 5ec8079

Browse files
committed
2025-01-27までの原文変更点反映。
1 parent f69d25a commit 5ec8079

File tree

8 files changed

+512
-118
lines changed

8 files changed

+512
-118
lines changed

original-en/collections.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ For the majority of the remaining collection documentation, we'll discuss each m
102102
[chunk](#method-chunk)
103103
[chunkWhile](#method-chunkwhile)
104104
[collapse](#method-collapse)
105+
[collapseWithKeys](#method-collapsewithkeys)
105106
[collect](#method-collect)
106107
[combine](#method-combine)
107108
[concat](#method-concat)
@@ -141,7 +142,9 @@ For the majority of the remaining collection documentation, we'll discuss each m
141142
[hasAny](#method-hasany)
142143
[implode](#method-implode)
143144
[intersect](#method-intersect)
145+
[intersectUsing](#method-intersectusing)
144146
[intersectAssoc](#method-intersectAssoc)
147+
[intersectAssocUsing](#method-intersectassocusing)
145148
[intersectByKeys](#method-intersectbykeys)
146149
[isEmpty](#method-isempty)
147150
[isNotEmpty](#method-isnotempty)
@@ -401,6 +404,28 @@ The `collapse` method collapses a collection of arrays into a single, flat colle
401404

402405
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
403406

407+
<a name="method-collapsewithkeys"></a>
408+
#### `collapseWithKeys()` {.collection-method}
409+
410+
The `collapseWithKeys` method flattens a collection of arrays or collections into a single collection, keeping the original keys intact:
411+
412+
$collection = collect([
413+
['first' => collect([1, 2, 3])],
414+
['second' => [4, 5, 6]],
415+
['third' => collect([7, 8, 9])]
416+
]);
417+
418+
419+
$collapsed = $collection->collapseWithKeys();
420+
421+
$collapsed->all();
422+
423+
// [
424+
// 'first' => [1, 2, 3],
425+
// 'second' => [4, 5, 6],
426+
// 'third' => [7, 8, 9],
427+
// ]
428+
404429
<a name="method-collect"></a>
405430
#### `collect()` {.collection-method}
406431

@@ -1288,6 +1313,21 @@ The `intersect` method removes any values from the original collection that are
12881313
> [!NOTE]
12891314
> This method's behavior is modified when using [Eloquent Collections](/docs/{{version}}/eloquent-collections#method-intersect).
12901315
1316+
<a name="method-intersectusing"></a>
1317+
#### `intersectUsing()` {.collection-method}
1318+
1319+
The `intersectUsing` method removes any values from the original collection that are not present in the given `array` or collection, using a custom callback to compare the values. The resulting collection will preserve the original collection's keys:
1320+
1321+
$collection = collect(['Desk', 'Sofa', 'Chair']);
1322+
1323+
$intersect = $collection->intersectUsing(['desk', 'chair', 'bookcase'], function ($a, $b) {
1324+
return strcasecmp($a, $b);
1325+
});
1326+
1327+
$intersect->all();
1328+
1329+
// [0 => 'Desk', 2 => 'Chair']
1330+
12911331
<a name="method-intersectAssoc"></a>
12921332
#### `intersectAssoc()` {.collection-method}
12931333

@@ -1309,6 +1349,29 @@ The `intersectAssoc` method compares the original collection against another col
13091349

13101350
// ['size' => 'M']
13111351

1352+
<a name="method-intersectassocusing"></a>
1353+
#### `intersectAssocUsing()` {.collection-method}
1354+
1355+
The `intersectAssocUsing` method compares the original collection against another collection or `array`, returning the key / value pairs that are present in both, using a custom comparison callback to determine equality for both keys and values:
1356+
1357+
$collection = collect([
1358+
'color' => 'red',
1359+
'Size' => 'M',
1360+
'material' => 'cotton',
1361+
]);
1362+
1363+
$intersect = $collection->intersectAssocUsing([
1364+
'color' => 'blue',
1365+
'size' => 'M',
1366+
'material' => 'polyester',
1367+
], function ($a, $b) {
1368+
return strcasecmp($a, $b);
1369+
});
1370+
1371+
$intersect->all();
1372+
1373+
// ['Size' => 'M']
1374+
13121375
<a name="method-intersectbykeys"></a>
13131376
#### `intersectByKeys()` {.collection-method}
13141377

original-en/urls.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ If no path is provided to the `url` helper, an `Illuminate\Routing\UrlGenerator`
6868
// Get the full URL for the previous request...
6969
echo url()->previous();
7070

71+
// Get the path for the previous request...
72+
echo url()->previousPath();
73+
7174
Each of these methods may also be accessed via the `URL` [facade](/docs/{{version}}/facades):
7275

7376
use Illuminate\Support\Facades\URL;

original-en/validation.md

Lines changed: 117 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -863,81 +863,156 @@ Below is a list of all available validation rules and their function:
863863
}
864864
</style>
865865

866+
#### Booleans
867+
866868
<div class="collection-method-list" markdown="1">
867869

868870
[Accepted](#rule-accepted)
869871
[Accepted If](#rule-accepted-if)
872+
[Boolean](#rule-boolean)
873+
[Declined](#rule-declined)
874+
[Declined If](#rule-declined-if)
875+
876+
</div>
877+
878+
#### Strings
879+
880+
<div class="collection-method-list" markdown="1">
881+
870882
[Active URL](#rule-active-url)
871-
[After (Date)](#rule-after)
872-
[After Or Equal (Date)](#rule-after-or-equal)
873883
[Alpha](#rule-alpha)
874884
[Alpha Dash](#rule-alpha-dash)
875885
[Alpha Numeric](#rule-alpha-num)
876-
[Array](#rule-array)
877886
[Ascii](#rule-ascii)
878-
[Bail](#rule-bail)
879-
[Before (Date)](#rule-before)
880-
[Before Or Equal (Date)](#rule-before-or-equal)
881-
[Between](#rule-between)
882-
[Boolean](#rule-boolean)
883887
[Confirmed](#rule-confirmed)
884-
[Contains](#rule-contains)
885888
[Current Password](#rule-current-password)
886-
[Date](#rule-date)
887-
[Date Equals](#rule-date-equals)
888-
[Date Format](#rule-date-format)
889-
[Decimal](#rule-decimal)
890-
[Declined](#rule-declined)
891-
[Declined If](#rule-declined-if)
892889
[Different](#rule-different)
893-
[Digits](#rule-digits)
894-
[Digits Between](#rule-digits-between)
895-
[Dimensions (Image Files)](#rule-dimensions)
896-
[Distinct](#rule-distinct)
897890
[Doesnt Start With](#rule-doesnt-start-with)
898891
[Doesnt End With](#rule-doesnt-end-with)
899892
[Email](#rule-email)
900893
[Ends With](#rule-ends-with)
901894
[Enum](#rule-enum)
902-
[Exclude](#rule-exclude)
903-
[Exclude If](#rule-exclude-if)
904-
[Exclude Unless](#rule-exclude-unless)
905-
[Exclude With](#rule-exclude-with)
906-
[Exclude Without](#rule-exclude-without)
907-
[Exists (Database)](#rule-exists)
908-
[Extensions](#rule-extensions)
909-
[File](#rule-file)
910-
[Filled](#rule-filled)
911-
[Greater Than](#rule-gt)
912-
[Greater Than Or Equal](#rule-gte)
913895
[Hex Color](#rule-hex-color)
914-
[Image (File)](#rule-image)
915896
[In](#rule-in)
916-
[In Array](#rule-in-array)
917-
[Integer](#rule-integer)
918897
[IP Address](#rule-ip)
919898
[JSON](#rule-json)
920-
[Less Than](#rule-lt)
921-
[Less Than Or Equal](#rule-lte)
922-
[List](#rule-list)
923899
[Lowercase](#rule-lowercase)
924900
[MAC Address](#rule-mac)
925901
[Max](#rule-max)
902+
[Min](#rule-min)
903+
[Not In](#rule-not-in)
904+
[Regular Expression](#rule-regex)
905+
[Not Regular Expression](#rule-not-regex)
906+
[Same](#rule-same)
907+
[Size](#rule-size)
908+
[Starts With](#rule-starts-with)
909+
[String](#rule-string)
910+
[Uppercase](#rule-uppercase)
911+
[URL](#rule-url)
912+
[ULID](#rule-ulid)
913+
[UUID](#rule-uuid)
914+
915+
</div>
916+
917+
#### Numbers
918+
919+
<div class="collection-method-list" markdown="1">
920+
921+
[Between](#rule-between)
922+
[Decimal](#rule-decimal)
923+
[Different](#rule-different)
924+
[Digits](#rule-digits)
925+
[Digits Between](#rule-digits-between)
926+
[Greater Than](#rule-gt)
927+
[Greater Than Or Equal](#rule-gte)
928+
[Integer](#rule-integer)
929+
[Less Than](#rule-lt)
930+
[Less Than Or Equal](#rule-lte)
931+
[Max](#rule-max)
926932
[Max Digits](#rule-max-digits)
927-
[MIME Types](#rule-mimetypes)
928-
[MIME Type By File Extension](#rule-mimes)
929933
[Min](#rule-min)
930934
[Min Digits](#rule-min-digits)
935+
[Multiple Of](#rule-multiple-of)
936+
[Numeric](#rule-numeric)
937+
[Same](#rule-same)
938+
[Size](#rule-size)
939+
940+
</div>
941+
942+
#### Arrays
943+
944+
<div class="collection-method-list" markdown="1">
945+
946+
[Array](#rule-array)
947+
[Between](#rule-between)
948+
[Contains](#rule-contains)
949+
[Distinct](#rule-distinct)
950+
[In Array](#rule-in-array)
951+
[List](#rule-list)
952+
[Max](#rule-max)
953+
[Min](#rule-min)
954+
[Size](#rule-size)
955+
956+
</div>
957+
958+
#### Dates
959+
960+
<div class="collection-method-list" markdown="1">
961+
962+
[After](#rule-after)
963+
[After Or Equal](#rule-after-or-equal)
964+
[Before](#rule-before)
965+
[Before Or Equal](#rule-before-or-equal)
966+
[Date](#rule-date)
967+
[Date Equals](#rule-date-equals)
968+
[Date Format](#rule-date-format)
969+
[Different](#rule-different)
970+
[Timezone](#rule-timezone)
971+
972+
</div>
973+
974+
#### Files
975+
976+
<div class="collection-method-list" markdown="1">
977+
978+
[Between](#rule-between)
979+
[Dimensions](#rule-dimensions)
980+
[Extensions](#rule-extensions)
981+
[File](#rule-file)
982+
[Image](#rule-image)
983+
[Max](#rule-max)
984+
[MIME Types](#rule-mimetypes)
985+
[MIME Type By File Extension](#rule-mimes)
986+
[Size](#rule-size)
987+
988+
</div>
989+
990+
#### Database
991+
992+
<div class="collection-method-list" markdown="1">
993+
994+
[Exists](#rule-exists)
995+
[Unique](#rule-unique)
996+
997+
</div>
998+
999+
#### Utilities
1000+
1001+
<div class="collection-method-list" markdown="1">
1002+
1003+
[Bail](#rule-bail)
1004+
[Exclude](#rule-exclude)
1005+
[Exclude If](#rule-exclude-if)
1006+
[Exclude Unless](#rule-exclude-unless)
1007+
[Exclude With](#rule-exclude-with)
1008+
[Exclude Without](#rule-exclude-without)
1009+
[Filled](#rule-filled)
9311010
[Missing](#rule-missing)
9321011
[Missing If](#rule-missing-if)
9331012
[Missing Unless](#rule-missing-unless)
9341013
[Missing With](#rule-missing-with)
9351014
[Missing With All](#rule-missing-with-all)
936-
[Multiple Of](#rule-multiple-of)
937-
[Not In](#rule-not-in)
938-
[Not Regex](#rule-not-regex)
9391015
[Nullable](#rule-nullable)
940-
[Numeric](#rule-numeric)
9411016
[Present](#rule-present)
9421017
[Present If](#rule-present-if)
9431018
[Present Unless](#rule-present-unless)
@@ -947,7 +1022,6 @@ Below is a list of all available validation rules and their function:
9471022
[Prohibited If](#rule-prohibited-if)
9481023
[Prohibited Unless](#rule-prohibited-unless)
9491024
[Prohibits](#rule-prohibits)
950-
[Regular Expression](#rule-regex)
9511025
[Required](#rule-required)
9521026
[Required If](#rule-required-if)
9531027
[Required If Accepted](#rule-required-if-accepted)
@@ -958,17 +1032,7 @@ Below is a list of all available validation rules and their function:
9581032
[Required Without](#rule-required-without)
9591033
[Required Without All](#rule-required-without-all)
9601034
[Required Array Keys](#rule-required-array-keys)
961-
[Same](#rule-same)
962-
[Size](#rule-size)
9631035
[Sometimes](#validating-when-present)
964-
[Starts With](#rule-starts-with)
965-
[String](#rule-string)
966-
[Timezone](#rule-timezone)
967-
[Unique (Database)](#rule-unique)
968-
[Uppercase](#rule-uppercase)
969-
[URL](#rule-url)
970-
[ULID](#rule-ulid)
971-
[UUID](#rule-uuid)
9721036

9731037
</div>
9741038

0 commit comments

Comments
 (0)