Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

helpers.php 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. use App\Helpers\LocationDataLoader;
  3. use Illuminate\Support\Collection;
  4. if (!function_exists('country')) {
  5. function country($countryCode, $hydrate = true)
  6. {
  7. return LocationDataLoader::getCountry($countryCode, $hydrate);
  8. }
  9. }
  10. if (!function_exists('countries')) {
  11. function countries($hydrate = true): Collection
  12. {
  13. return LocationDataLoader::getAllCountries($hydrate);
  14. }
  15. }
  16. if (!function_exists('state')) {
  17. function state($stateCode, $hydrate = true)
  18. {
  19. return LocationDataLoader::getState($stateCode, $hydrate);
  20. }
  21. }
  22. if (!function_exists('states')) {
  23. function states($countryCode, $hydrate = true): Collection
  24. {
  25. return LocationDataLoader::getAllStates($countryCode, $hydrate);
  26. }
  27. }
  28. if (!function_exists('city')) {
  29. function city($cityId, $hydrate = true)
  30. {
  31. return LocationDataLoader::getCity($cityId, $hydrate);
  32. }
  33. }
  34. if (!function_exists('cities')) {
  35. function cities($countryCode, $stateCode, $hydrate = true): Collection
  36. {
  37. return LocationDataLoader::getAllCities($countryCode, $stateCode, $hydrate);
  38. }
  39. }