Skip to content

Commit d687933

Browse files
committed
fix attribute
1 parent 3d63158 commit d687933

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Traits/MorphOneWallet.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,12 @@ public function wallet(): MorphOne
4545

4646
public function getWalletAttribute(): ?WalletModel
4747
{
48+
/** @var WalletModel $wallet */
4849
$wallet = $this->getRelationValue('wallet');
49-
if ($wallet === null) {
50-
return null;
51-
}
52-
53-
assert($wallet instanceof WalletModel);
5450

5551
if (!$wallet->relationLoaded('holder')) {
5652
$holder = app(CastServiceInterface::class)->getHolder($this);
57-
$wallet->setRelation('holder', $holder);
53+
$wallet->setRelation('holder', $holder->withoutRelations());
5854
}
5955

6056
return $wallet;

0 commit comments

Comments
 (0)