TIP 61 / 100

Automatic Records Chunking.

Similar to each() method, but easier to use. Automatically splits the result into parts (chunks).

php
return User::orderBy('name')->chunkMap(fn ($user) => [
    'id' => $user->id,
    'name' => $user->name,
]), 25);