We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d63158 commit d687933Copy full SHA for d687933
src/Traits/MorphOneWallet.php
@@ -45,16 +45,12 @@ public function wallet(): MorphOne
45
46
public function getWalletAttribute(): ?WalletModel
47
{
48
+ /** @var WalletModel $wallet */
49
$wallet = $this->getRelationValue('wallet');
- if ($wallet === null) {
50
- return null;
51
- }
52
-
53
- assert($wallet instanceof WalletModel);
54
55
if (!$wallet->relationLoaded('holder')) {
56
$holder = app(CastServiceInterface::class)->getHolder($this);
57
- $wallet->setRelation('holder', $holder);
+ $wallet->setRelation('holder', $holder->withoutRelations());
58
}
59
60
return $wallet;
0 commit comments