[fix] allow BelongsToThrough with tenant. (#18040)

Signed-off-by: Mathieu TUDISCO <oss@mathieutu.dev>
This commit is contained in:
Mathieu TUDISCO
2025-10-03 11:49:14 +01:00
committed by GitHub
parent 0b4875e814
commit 5ee3c32162
@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\Relations\Relation;
use LogicException;
use Znck\Eloquent\Relations\BelongsToThrough;
trait BelongsToTenant
{
@@ -176,7 +177,7 @@ trait BelongsToTenant
$relationship = static::getTenantOwnershipRelationship($record);
if ($relationship instanceof BelongsTo) {
if ($relationship instanceof BelongsTo || $relationship instanceof BelongsToThrough) {
return;
}