update resources

Signed-off-by: Maurice Preuß (envoyr) <hello@envoyr.com>
This commit is contained in:
envoyr committed 2025-05-02 06:27:53 +02:00
1 parent 1725ec68de
commit 1d2119a32b
33 files changed
+303 -320

No files matched your search

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