Skip to content

Conversation

@techmahedy
Copy link
Member

@techmahedy techmahedy commented Jan 21, 2026

Added sortBy() and sortByDesc() methods to Collection class

Example usage

// Sort users by age ascending
$sorted = $users->sortBy('age');

// Sort by age descending
$sorted = $users->sortByDesc('age');

// Sort with callback
$sorted = $users->sortBy(fn($user) => strlen($user['name']));

// Sort with numeric comparison
$sorted = $items->sortBy('price', SORT_NUMERIC);

@techmahedy techmahedy merged commit c29556f into doppar:3.x Jan 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant