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