diff --git a/src/Traits/HasHandlerTenantScope.php b/src/Traits/HasHandlerTenantScope.php index b7d1e90..b981777 100644 --- a/src/Traits/HasHandlerTenantScope.php +++ b/src/Traits/HasHandlerTenantScope.php @@ -55,7 +55,7 @@ protected static function modifyTenantQuery(Builder $query, ?Model $tenant = nul ApiService::tenancyAwareness() && static::isScopedToTenant() && $tenantId && - $tenant = $tenantModel::where(Filament::getCurrentPanel()->getTenantSlugAttribute() ?? $tenantModel->getKeyName(), $tenantId)->first() + $tenant = $tenantModel::where(Filament::getCurrentPanel()->getTenantSlugAttribute() ?? $tenantModel->getRouteKeyName(), $tenantId)->first() ) { if (auth()->check()) {