Thoughts, stories and ideas.

Call "transform" or "map" on paginated results in Laravel Eloquent

$query = Users::paginate();
$tap = tap($query)->transform(function($user) {
    // do something with the data
});

Subscribe to The Web Bard

Sign up now to get access to the library of members-only issues.
Jamie Larson
Subscribe