laravel 集合详细文档:https://learnku.com/docs/laravel/8.x/collections/9390#method-get



$users = User::all();//获取所有的数据
$user = $users->where('id', 2);//筛选id=2的数据