Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

State.php 344B

12345678910111213141516
  1. <?php
  2. namespace App\Faker;
  3. use App\Models\Locale\State as StateModel;
  4. use Faker\Provider\Base;
  5. class State extends Base
  6. {
  7. public function state(string $countryCode, string $column = 'id'): mixed
  8. {
  9. $state = StateModel::where('country_code', $countryCode)->inRandomOrder()->first();
  10. return $state?->{$column};
  11. }
  12. }