You can find multiple records with whereKey() method which takes care of which field is exactly your primary key.
$users = User::whereKey([1,2,3])->get();
Column id is the default, but you may override it in Eloquent Model by changing the $primaryKey property.
Enjoyed This Tip?
Get access to all premium tutorials, video and text courses, and exclusive Laravel resources. Join our community of 10,000+ developers.
Recent Courses on Laravel Daily
Mobile Apps: React Native vs Flutter vs NativePHP?
8 lessons
55 min
Next.js Basics for Laravel Developers
11 lessons
58 min
Laravel 13 Starter Kit Teams and Customizations
10 lessons
33 min