mirror of
https://github.com/anikeen-com/id.git
synced 2026-03-15 06:36: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\Countries;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Throwable;
|
||||
|
||||
trait ManagesCountries
|
||||
{
|
||||
@@ -14,12 +14,15 @@ trait ManagesCountries
|
||||
/**
|
||||
* Get available countries for the current user.
|
||||
*
|
||||
* @throws RequestRequiresClientIdException
|
||||
* @throws GuzzleException
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function countries(): Countries
|
||||
{
|
||||
return (new Countries($this->request('GET', 'v1/countries')))
|
||||
->setBillable($this);
|
||||
if (!isset($this->countriesCache)) {
|
||||
$this->countriesCache = Countries::builder(fn() => $this->request('GET', 'v1/countries'))
|
||||
->setBillable($this);
|
||||
}
|
||||
|
||||
return $this->countriesCache;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user