Support the ongoing development of Laravel.io →
Database Eloquent Queues

There are two tables which are in different databases. Let's say one of them is Users and another is Cars. Cars has column 'user_id' in it. Is it possible to create models for these two tables (Car and User), so that I could eager load the relations when I query Users? Like this: User::find(3)->with('cars')->get();

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.