Did you set up proper Eloquent relationships? Then check out Querying Relationship Existence.
// Retrieve all customers that have at least one booking...
$customersWithBookings = App\Customer::has('bookings')->get();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I got a Database like this:
Customers: id, name
Inquiries: id customer_id
Bookings: id inquiry_id
Now i want to search all customers who made a booking, but i don't know how... can you help me?
Please or to participate in this conversation.