mirror of
https://github.com/anikeen-com/id.git
synced 2026-03-14 22:26:14 +00:00
update resources
Signed-off-by: Maurice Preuß (envoyr) <hello@envoyr.com>
This commit is contained in:
@@ -5,7 +5,7 @@ namespace Anikeen\Id\Concerns;
|
||||
use Anikeen\Id\ApiOperations\Request;
|
||||
use Anikeen\Id\Exceptions\RequestRequiresClientIdException;
|
||||
use Anikeen\Id\Resources\Subscriptions;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Throwable;
|
||||
|
||||
trait ManagesSubscriptions
|
||||
{
|
||||
@@ -14,12 +14,15 @@ trait ManagesSubscriptions
|
||||
/**
|
||||
* Get subscriptions from the current user.
|
||||
*
|
||||
* @throws RequestRequiresClientIdException
|
||||
* @throws GuzzleException
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function subscriptions(): Subscriptions
|
||||
{
|
||||
return (new Subscriptions($this->request('GET', 'v1/subscriptions')))
|
||||
->setBillable($this);
|
||||
if (!isset($this->subscriptionsCache)) {
|
||||
$this->subscriptionsCache = Subscriptions::builder(fn() => $this->request('GET', 'v1/subscriptions'))
|
||||
->setBillable($this);
|
||||
}
|
||||
|
||||
return $this->subscriptionsCache;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user