🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## whereInstanceOf 方法根据给定的类来过滤集合: whereInstanceOf 方法根据给定的类来过滤集合: ``` use App\Models\User; use App\Models\Post; $collection = collect([ new User, new User, new Post, ]); $filtered = $collection->whereInstanceOf(User::class); $filtered->all(); // [App\Models\User, App\Models\User] ```