您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CurrencyCode.php 404B

12345678910111213141516171819
  1. <?php
  2. namespace App\Faker;
  3. use App\Models\Locale\Country;
  4. use Faker\Provider\Base;
  5. use OutOfBoundsException;
  6. class CurrencyCode extends Base
  7. {
  8. public function currencyCode(string $countryCode): string
  9. {
  10. try {
  11. return Country::where('id', $countryCode)->pluck('currency_code')->first();
  12. } catch (OutOfBoundsException $e) {
  13. return 'MYR';
  14. }
  15. }
  16. }