Skip to content

Commit

Permalink
Merge pull request #1 from gkmk/gkmk-payments
Browse files Browse the repository at this point in the history
Add payments relation on wallet
  • Loading branch information
gkmk authored Jan 30, 2024
2 parents 923f182 + 30bacfc commit c64ef5c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Traits/HasWallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,18 @@ public function transfers(): HasMany
->hasMany(config('wallet.transfer.model', Transfer::class), 'from_id')
;
}

/**
* returns all the receiving transfers to this wallet.
*
* @return HasMany<Transfer>
*/
public function payments(): HasMany

Check warning on line 236 in src/Traits/HasWallet.php

View check run for this annotation

Codecov / codecov/patch

src/Traits/HasWallet.php#L236

Added line #L236 was not covered by tests
{
/** @var Wallet $this */
return app(CastServiceInterface::class)
->getWallet($this, false)
->hasMany(config('wallet.transfer.model', Transfer::class), 'to_id')
;

Check warning on line 242 in src/Traits/HasWallet.php

View check run for this annotation

Codecov / codecov/patch

src/Traits/HasWallet.php#L239-L242

Added lines #L239 - L242 were not covered by tests
}
}

0 comments on commit c64ef5c

Please sign in to comment.