In Laravel you can fetch a related database entry in one query with the with method like this:
$customer = Customer::with('user')->where([
'id' =>'1'
])->first();
Which will return a customer and it's related user object. Is it possible to apply a filter to this with item? I thought that this would be possible:
$customer = Customer::with('user')->where([
'id' =>'1',
'users.status' => 'activated'
])->first();
But that does not seem to work, it tries to find a column "users.status" instead of a column status in the users table.