diff --git a/packages/actions/src/Exports/Models/Export.php b/packages/actions/src/Exports/Models/Export.php index a1bded4009..6a13c1e7ad 100644 --- a/packages/actions/src/Exports/Models/Export.php +++ b/packages/actions/src/Exports/Models/Export.php @@ -46,17 +46,8 @@ class Export extends Model $authenticatable = app(Authenticatable::class); - if ($authenticatable) { - /** @phpstan-ignore-next-line */ - return $this->belongsTo($authenticatable::class); - } - - if (! class_exists(User::class)) { - throw new Exception('No [App\\Models\\User] model found. Please bind an authenticatable model to the [Illuminate\\Contracts\\Auth\\Authenticatable] interface in a service provider\'s [register()] method.'); - } - /** @phpstan-ignore-next-line */ - return $this->belongsTo(User::class); + return $this->belongsTo($authenticatable::class); } /** diff --git a/packages/actions/src/Imports/Models/Import.php b/packages/actions/src/Imports/Models/Import.php index 64f0b5fd1c..49a64c9f66 100644 --- a/packages/actions/src/Imports/Models/Import.php +++ b/packages/actions/src/Imports/Models/Import.php @@ -52,17 +52,8 @@ class Import extends Model $authenticatable = app(Authenticatable::class); - if ($authenticatable) { - /** @phpstan-ignore-next-line */ - return $this->belongsTo($authenticatable::class); - } - - if (! class_exists(User::class)) { - throw new Exception('No [App\\Models\\User] model found. Please bind an authenticatable model to the [Illuminate\\Contracts\\Auth\\Authenticatable] interface in a service provider\'s [register()] method.'); - } - /** @phpstan-ignore-next-line */ - return $this->belongsTo(User::class); + return $this->belongsTo($authenticatable::class); } /**