📜  搜索 laravel - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:16.550000             🧑  作者: Mango

代码示例4
$users = User::has('posts')->withCount('posts')->orderBy('posts_count')->take(50)->get();

$userIndex = $users->search(function($user) {
    return $user->id === Auth::id();
});