Skip to content

Commit b6b42e8

Browse files
committed
formatting
1 parent 04bd255 commit b6b42e8

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

helpers.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -514,15 +514,15 @@ The `array_wrap` function will wrap the given value in an array. If the given va
514514
<a name="method-data-fill"></a>
515515
#### `data_fill()` {#collection-method}
516516

517-
The `data_fill` function will fill data in the target array or object where needed, using "dot" notation:
517+
The `data_fill` function will fill data in the target array or object using "dot" notation:
518518

519519
$data = ['foo' => 'bar'];
520520

521521
data_fill($data, 'baz', 'boom')
522522

523523
// ['foo' => 'bar', 'baz' => 'boom']
524524

525-
This function also accepts asterisks as wildcards, and will fill into the target accordingly:
525+
This function also accepts asterisks as wildcards and will fill the target accordingly:
526526

527527
$data = [
528528
'posts' => [
@@ -533,14 +533,14 @@ This function also accepts asterisks as wildcards, and will fill into the target
533533
]
534534
];
535535

536-
data_fill($data,'posts.comments.*.name','No name');
536+
data_fill($data,'posts.comments.*.name', 'N/A');
537537

538538
/*
539539
[
540540
'posts' => [
541541
'comments' => [
542542
['name' => 'Taylor'],
543-
['name' => 'No name']
543+
['name' => 'N/A']
544544
],
545545
]
546546
];
@@ -557,27 +557,27 @@ The `data_get` function retrieves a value from a nested array or object using "d
557557

558558
// ['price' => 100]
559559

560-
The `data_get` function also accepts a default value, which will be returned if the specific key is not found:
560+
The `data_get` function also accepts a default value, which will be returned if the specified key is not found:
561561

562562
$value = data_get($data, 'names.john', 'default');
563563

564564
<a name="method-data-set"></a>
565565
#### `data_set()` {#collection-method}
566566

567-
The `data_set` function sets a value within a deeply nested array or object using "dot" notation:
567+
The `data_set` function sets a value within a nested array or object using "dot" notation:
568568

569569
$data = ['products' => ['desk' => ['price' => 100]]];
570570

571571
data_set($data, 'products.desk.price', 200);
572572

573573
// ['products' => ['desk' => ['price' => 200]]]
574574

575-
This function also accepts wildcards, and will set values in the target accordingly:
575+
This function also accepts wildcards and will set values on the target accordingly:
576576

577577
$data = [
578578
'products' => [
579-
['name' => 'desk1', 'price' => 100],
580-
['name' => 'desk2', 'price' => 150],
579+
['name' => 'Desk 1', 'price' => 100],
580+
['name' => 'Desk 2', 'price' => 150],
581581
]
582582
];
583583

@@ -586,21 +586,20 @@ This function also accepts wildcards, and will set values in the target accordin
586586
/*
587587
[
588588
'products' => [
589-
['name'=> 'desk1' => 'price' => 200],
590-
['name'=> 'desk2' => 'price' => 200],
589+
['name'=> 'Desk 1' => 'price' => 200],
590+
['name'=> 'Desk 2' => 'price' => 200],
591591
]
592592
];
593593
*/
594594

595-
By default, any existing values are overwritten. If you wish only set a value if it doesn't exist, you may pass `false` as the third parameter:
595+
By default, any existing values are overwritten. If you wish to only set a value if it doesn't exist, you may pass `false` as the third parameter:
596596

597597
$data = ['products' => ['desk' => ['price' => 100]]];
598598

599599
data_set($data, 'products.desk.price', 200, false);
600600

601601
// ['products' => ['desk' => ['price' => 100]]]
602602

603-
604603
<a name="method-head"></a>
605604
#### `head()` {#collection-method}
606605

@@ -1104,7 +1103,7 @@ The `broadcast` function [broadcasts](/docs/{{version}}/broadcasting) the given
11041103
<a name="method-blank"></a>
11051104
#### `blank()` {#collection-method}
11061105

1107-
The `blank` function returns whether the given value is blank":
1106+
The `blank` function returns whether the given value is "blank":
11081107

11091108
// true
11101109
blank('');
@@ -1229,7 +1228,7 @@ The `factory` function creates a model factory builder for a given class, name,
12291228
<a name="method-filled"></a>
12301229
#### `filled()` {#collection-method}
12311230

1232-
The `filled` function returns whether the given value is not blank":
1231+
The `filled` function returns whether the given value is not "blank":
12331232

12341233
// true
12351234
filled(0);
@@ -1441,19 +1440,19 @@ The `throw_unless` function throws the given exception if a given boolean expres
14411440
<a name="method-transform"></a>
14421441
#### `transform()` {#collection-method}
14431442

1444-
The `transform` function executes a Closure on a given value, if the value is not blank, and returns the result of that Closure:
1443+
The `transform` function executes a Closure on a given value if the value is not [blank](#method-blank) and returns the result of the Closure:
14451444

14461445
transform(5, function ($value) {
14471446
return $value * 2;
14481447
});
14491448

14501449
// 10
14511450

1452-
A default value or Closure may also be passed as the third parameter to the method, which is used if the given value is blank:
1451+
A default value or Closure may also be passed as the third parameter to the method. This value will be returned if the given value is blank:
14531452

14541453
transform(null, function ($value) {
14551454
return $value * 2;
1456-
}, "Value is blank");
1455+
}, "The value is blank.");
14571456

14581457
<a name="method-validator"></a>
14591458
#### `validator()` {#collection-method}

0 commit comments

Comments
 (0)