Skip to content

Commit ec0cd0c

Browse files
[8.x] Add documentation for lazyByIdDesc method (#7488)
* Add missing semi-colon * Document `lazyByIdDesc` method * Update eloquent.md * Update queries.md Co-authored-by: Taylor Otwell <[email protected]>
1 parent 3b24c4c commit ec0cd0c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

eloquent.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,8 @@ Flight::where('departed', true)
388388
->each->update(['departed' => false]);
389389
```
390390

391+
You may filter the results based on the descending order of the `id` using the `lazyByIdDesc` method.
392+
391393
<a name="cursors"></a>
392394
### Cursors
393395

@@ -948,7 +950,7 @@ If you wish to exclude certain models from being pruned while pruning all other
948950

949951
$schedule->command('model:prune', [
950952
'--except' => [Address::class, Flight::class],
951-
])->daily()
953+
])->daily();
952954

953955
You may test your `prunable` query by executing the `model:prune` command with the `--pretend` option. When pretending, the `model:prune` command will simply report how many records would be pruned if the command were to actually run:
954956

queries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ DB::table('users')->orderBy('id')->lazy()->each(function ($user) {
168168
});
169169
```
170170

171-
Once again, if you plan to update the retrieved records while iterating over them, it is best to use the `lazyById` method instead. This method will automatically paginate the results based on the record's primary key:
171+
Once again, if you plan to update the retrieved records while iterating over them, it is best to use the `lazyById` or `lazyByIdDesc` methods instead. These methods will automatically paginate the results based on the record's primary key:
172172

173173
```php
174174
DB::table('users')->where('active', false)

0 commit comments

Comments
 (0)