File: //var/www/quadcode/app/Helpers/RegionHelper.php
<?php
namespace App\Helpers;
class RegionHelper
{
public const NORTH_AMERICA = '1';
public const EUROPE = '2';
public const ASIA_PACIFIC = '3';
public const SOUTH_AMERICA = '4';
public const AFRICA = '5';
public const MIDDLE_EAST = '6';
public static array $regions = [
self::NORTH_AMERICA => 'North America',
self::EUROPE => 'Europe',
self::ASIA_PACIFIC => 'Asia-Pacific',
self::SOUTH_AMERICA => 'South America',
self::AFRICA => 'Africa',
self::MIDDLE_EAST => 'Middle East',
];
public static function getRegion(?string $region = null): string
{
if (!isset($region)) {
return '';
}
return self::$regions[$region] ?? '';
}
}