📅  最后修改于: 2022-03-11 14:54:41.654000             🧑  作者: Mango
$users = User::has('posts')->withCount('posts')->orderBy('posts_count')->take(50)->get();
$userIndex = $users->search(function($user) {
return $user->id === Auth::id();
});