I am using Laravel 5.6
The following code
BusinessAgreement::where(function ($q) {
$q->join('business_agreements as middleman', 'middleman.type_id', '=', 'business_agreements.type_id')
->join('business_agreement_users', 'business_agreement_users.business_agreement_id', '=', 'middleman.id')
->where('business_agreement_users.user_id', '=', $this->user->id);
})->toSql()
creates the following query:
select * from
business_agreements
where (business_agreement_users
.user_id
= ?) andbusiness_agreements
.deleted_at
is null"
This causes my query to fail because table business_agreement_users
is unknown.
Why is the inner join missing?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire