Country#
Country holds an ISO 3166-1 alpha-2 country code, or several,
country in the descriptor. It is a select preset over the assigned
codes, searchable by default:
Country::make('country')->filterable(), // one code, a string property
Country::make('countries', 'Countries served')->multiple(), // several, an array property
Country::make('market')->only(['NL', 'DE', 'AT']), // these codes only, in this order
It is a Select in every other respect: the same storage
rules (a string property for one code, an array or ?array property
for several), badge(), the same filters (eq ne in nin, or any all
for a multiple one) and the same strictness. Codes are upper case: de,
DEU and Germany are refused with invalid_choice. only() narrows
the list, and the build refuses a code that is not assigned. The server
names each code in English (in vector_describe, OpenAPI and exports);
the admin shows the name in the UI’s language, for each shipped locale,
from data generated with scripts/generate-countries.mjs. The codes
and names live in Kinetis\Vector\Support\Countries.
It takes the common modifiers too.