Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MoFish's avatar

Relationship Query

Hi,

If i perform the following query I get the attributes from table 1.

$data = Build::find($id)->get();

If I perform the following query I get the attributes from table 2.

$data = Build::find($id)->website;

I'm struggling to find the syntax to get the attributes from table 1 and table 2 at the same time.

Thanks.

0 likes
2 replies
MoFish's avatar

Thank you Michal. I was trying it the wrong way around and couldn't find it in the docs.

Please or to participate in this conversation.