phpvms/app/Support/Countries.php

25 lines
473 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 \Illuminate\Support\Collection
*/
public static function getSelectList()
{
return collect((new ISO3166())->all())
2019-04-08 07:09:29 +08:00
->mapWithKeys(static function ($item, $key) {
return [strtolower($item['alpha2']) => $item['name']];
});
}
}