Files
id/src/Id/Concerns/ManagesTransactions.php
T
2025-09-21 17:12:19 +00:00

27 lines
606 B
PHP

<?php
namespace Anikeen\Id\Concerns;
use Anikeen\Id\Resources\Transactions;
use Throwable;
trait ManagesTransactions
{
use HasBillable;
/**
* Get transactions from the current user.
*
* @throws Throwable
*/
public function transactions(): Transactions
{
if (!isset($this->transactionsCache)) {
$this->transactionsCache = Transactions::builder(fn() => $this->anikeenId()
->request('GET', 'v1/transactions'))
->setBillable($this);
}
return $this->transactionsCache;
}
}