Replies: 1 comment 3 replies
-
You can filter your relationship by its pivot table https://laravel.com/docs/8.x/eloquent-relationships#filtering-queries-via-intermediate-table-columns |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
we have a DB relationship as follows:
Table A
Table B
Table C
where C is the relationship table between A and B
we wrote the relationship as follows inside Model A:
$this->belongsToMany(B::class, 'table_c', 'a_id', 'b_id')
As you can see query do not include soft delete condition in inner join! How to achieve this?
deleted
is a soft delete column.Beta Was this translation helpful? Give feedback.
All reactions