phpvms/app/Support/Countries.php

27 lines
483 B
PHP
Raw Normal View History

<?php
namespace App\Support;
2019-04-08 07:09:29 +08:00
use League\ISO3166\ISO3166;
/**
* Class Countries
*/
class Countries
{
/**
* Get a select box list of all the countries
2018-08-27 00:40:04 +08:00
*
* @return static
*/
public static function getSelectList()
{
2019-04-08 07:09:29 +08:00
$countries = collect((new ISO3166())->all())
->mapWithKeys(static function ($item, $key) {
return [strtolower($item['alpha2']) => $item['name']];
});
return $countries;
}
}