diff --git a/src/Models/Transfer.php b/src/Models/Transfer.php index 89f23444b..aa13882a6 100644 --- a/src/Models/Transfer.php +++ b/src/Models/Transfer.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\MorphTo; use function config; /** @@ -79,17 +80,17 @@ public function getTable(): string /** * @return BelongsTo */ - public function from(): BelongsTo + public function from(): MorphTo { - return $this->belongsTo(config('wallet.wallet.model', Wallet::class), 'from_id'); + return $this->morphTo(); } /** * @return BelongsTo */ - public function to(): BelongsTo + public function to(): MorphTo { - return $this->belongsTo(config('wallet.wallet.model', Wallet::class), 'to_id'); + return $this->morphTo(); } /**