refactor code

This commit is contained in:
envoyr committed 2025-09-21 17:12:19 +00:00
1 parent c641ec725d
commit 25248e7822
37 files changed
+180 -143

No files matched your search

+3 -4
View File
@@ -2,14 +2,12 @@
namespace Anikeen\Id\Concerns;
use Anikeen\Id\ApiOperations\Request;
use Anikeen\Id\Exceptions\RequestRequiresClientIdException;
use Anikeen\Id\Resources\Invoices;
use Throwable;
trait ManagesInvoices
{
use Request;
use HasBillable;
/**
* Get invoices from the current user.
@@ -19,7 +17,8 @@ trait ManagesInvoices
public function invoices(array $parameters = []): Invoices
{
if (!isset($this->invoicesCache)) {
$this->invoicesCache = Invoices::builder(fn() => $this->request('GET', 'v1/invoices', [], $parameters))
$this->invoicesCache = Invoices::builder(fn() => $this->anikeenId()
->request('GET', 'v1/invoices', [], $parameters))
->setBillable($this);
}