Skip to content

Commit a8d4db9

Browse files
authored
Update queries.md (#10320)
corrected mispelling of "destination"
1 parent b6829f9 commit a8d4db9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

queries.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1509,10 +1509,10 @@ namespace App\Scopes;
15091509

15101510
use Illuminate\Database\Query\Builder;
15111511

1512-
class DesinationFilter
1512+
class DestinationFilter
15131513
{
15141514
public function __construct(
1515-
private ?string $desination,
1515+
private ?string $destination,
15161516
) {
15171517
//
15181518
}
@@ -1537,7 +1537,7 @@ DB::table('flights')
15371537
->when($destination, function (Builder $query, string $destination) { // [tl! remove]
15381538
$query->where('destination', $destination); // [tl! remove]
15391539
}) // [tl! remove]
1540-
->tap(new DesinationFilter($destination)) // [tl! add]
1540+
->tap(new DestinationFilter($destination)) // [tl! add]
15411541
->orderByDesc('price')
15421542
->get();
15431543

@@ -1547,7 +1547,7 @@ DB::table('flights')
15471547
->when($destination, function (Builder $query, string $destination) { // [tl! remove]
15481548
$query->where('destination', $destination); // [tl! remove]
15491549
}) // [tl! remove]
1550-
->tap(new DesinationFilter($destination)) // [tl! add]
1550+
->tap(new DestinationFilter($destination)) // [tl! add]
15511551
->where('user', $request->user()->id)
15521552
->orderBy('destination')
15531553
->get();
@@ -1558,7 +1558,7 @@ DB::table('flights')
15581558

15591559
The `tap` method will always return the query builder. If you would like to extract an object that executes the query and returns another value, you may use the `pipe` method instead.
15601560

1561-
Consider the following query object that contains shared [pagination](/docs/{{version}}/pagination) logic used throughout an application. Unlike the `DesinationFilter`, which applies query conditions to the query, the `Paginate` object executes the query and returns a paginator instance:
1561+
Consider the following query object that contains shared [pagination](/docs/{{version}}/pagination) logic used throughout an application. Unlike the `DestinationFilter`, which applies query conditions to the query, the `Paginate` object executes the query and returns a paginator instance:
15621562

15631563
```php
15641564
<?php
@@ -1590,7 +1590,7 @@ Using the query builder's `pipe` method, we can leverage this object to apply ou
15901590

15911591
```php
15921592
$flights = DB::table('flights')
1593-
->tap(new DesinationFilter($destination))
1593+
->tap(new DestinationFilter($destination))
15941594
->pipe(new Paginate);
15951595
```
15961596

0 commit comments

Comments
 (0)