$users = User::has('posts')->withCount('posts')->orderBy('posts_count')->take(50)->get(); $userIndex = $users->search(function($user) { return $user->id === Auth::id(); });