native country select

This commit is contained in:
Benjamin Takats
2022-12-23 17:26:52 +01:00
parent abf5a5bb6a
commit 797ae37a3a
5 changed files with 298 additions and 21 deletions

View File

@@ -58,8 +58,16 @@ class Header extends Component
->select(['latitude', 'longitude'])
->get(),
'countries' => Country::query()
->select(['code', 'name'])
->get(),
->select('id', 'name', 'code')
->orderBy('name')
->get()
->map(function (Country $country) {
$country->name = config('countries.emoji_flags')[str($country->code)
->upper()
->toString()].' '.$country->name;
return $country;
}),
]);
}
}