mirror of
https://github.com/anikeen-com/id.git
synced 2026-11-01 13:19:34 +00:00
27 lines
585 B
PHP
27 lines
585 B
PHP
<?php
|
|
|
|
namespace Anikeen\Id\Concerns;
|
|
|
|
use Anikeen\Id\Resources\Countries;
|
|
use Throwable;
|
|
|
|
trait ManagesCountries
|
|
{
|
|
use HasBillable;
|
|
|
|
/**
|
|
* Get available countries for the current user.
|
|
*
|
|
* @throws Throwable
|
|
*/
|
|
public function countries(): Countries
|
|
{
|
|
if (!isset($this->countriesCache)) {
|
|
$this->countriesCache = Countries::builder(fn() => $this->anikeenId()
|
|
->request('GET', 'v1/countries'))
|
|
->setBillable($this);
|
|
}
|
|
|
|
return $this->countriesCache;
|
|
}
|
|
} |