new deployer command
This commit is contained in:
@@ -8,6 +8,11 @@ use Modules\Countries\Support\Iso3166;
|
||||
|
||||
class StoreCountryRequest extends FormRequest
|
||||
{
|
||||
private const ISO3 = 'size:3';
|
||||
|
||||
private const MAX_STRING = 'max:255';
|
||||
|
||||
private const MAX_SHORT = 'max:16';
|
||||
/**
|
||||
* Authorize country reference-data administration.
|
||||
*/
|
||||
@@ -38,29 +43,29 @@ class StoreCountryRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'alpha2' => ['required', 'string', 'size:2', 'uppercase', 'unique:countries,alpha2'],
|
||||
'alpha3' => ['required', 'string', 'size:3', 'uppercase', 'unique:countries,alpha3'],
|
||||
'numeric' => ['required', 'string', 'size:3', 'unique:countries,numeric'],
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'official_name' => ['nullable', 'string', 'max:255'],
|
||||
'common_name' => ['nullable', 'string', 'max:255'],
|
||||
'display_name' => ['nullable', 'string', 'max:255'],
|
||||
'native_name' => ['nullable', 'string', 'max:255'],
|
||||
'capital' => ['nullable', 'string', 'max:255'],
|
||||
'flag_emoji' => ['nullable', 'string', 'max:16'],
|
||||
'calling_code' => ['nullable', 'string', 'max:16'],
|
||||
'tld' => ['nullable', 'string', 'max:16'],
|
||||
'currency_code' => ['nullable', 'string', 'size:3', 'uppercase'],
|
||||
'currency_name' => ['nullable', 'string', 'max:255'],
|
||||
'currency_symbol' => ['nullable', 'string', 'max:16'],
|
||||
'alpha3' => ['required', 'string', self::ISO3, 'uppercase', 'unique:countries,alpha3'],
|
||||
'numeric' => ['required', 'string', self::ISO3, 'unique:countries,numeric'],
|
||||
'name' => ['required', 'string', self::MAX_STRING],
|
||||
'official_name' => ['nullable', 'string', self::MAX_STRING],
|
||||
'common_name' => ['nullable', 'string', self::MAX_STRING],
|
||||
'display_name' => ['nullable', 'string', self::MAX_STRING],
|
||||
'native_name' => ['nullable', 'string', self::MAX_STRING],
|
||||
'capital' => ['nullable', 'string', self::MAX_STRING],
|
||||
'flag_emoji' => ['nullable', 'string', self::MAX_SHORT],
|
||||
'calling_code' => ['nullable', 'string', self::MAX_SHORT],
|
||||
'tld' => ['nullable', 'string', self::MAX_SHORT],
|
||||
'currency_code' => ['nullable', 'string', self::ISO3, 'uppercase'],
|
||||
'currency_name' => ['nullable', 'string', self::MAX_STRING],
|
||||
'currency_symbol' => ['nullable', 'string', self::MAX_SHORT],
|
||||
'languages' => ['nullable', 'json'],
|
||||
'timezones' => ['nullable', 'json'],
|
||||
'latitude' => ['nullable', 'numeric', 'between:-90,90'],
|
||||
'longitude' => ['nullable', 'numeric', 'between:-180,180'],
|
||||
'flag_svg_url' => ['nullable', 'url', 'max:255'],
|
||||
'flag_png_url' => ['nullable', 'url', 'max:255'],
|
||||
'flag_svg_url' => ['nullable', 'url', self::MAX_STRING],
|
||||
'flag_png_url' => ['nullable', 'url', self::MAX_STRING],
|
||||
'ioc_code' => ['nullable', 'string', 'max:8'],
|
||||
'fifa_code' => ['nullable', 'string', 'max:8'],
|
||||
'postal_code_format' => ['nullable', 'string', 'max:255'],
|
||||
'postal_code_format' => ['nullable', 'string', self::MAX_STRING],
|
||||
'address_format' => ['nullable', 'string', 'max:5000'],
|
||||
'is_active' => ['required', 'boolean'],
|
||||
'iso_status' => ['required', 'string', Rule::in(Iso3166::statuses())],
|
||||
@@ -70,10 +75,10 @@ class StoreCountryRequest extends FormRequest
|
||||
'continent' => ['nullable', 'string', 'max:64'],
|
||||
'region' => ['nullable', 'string', 'max:100'],
|
||||
'subregion' => ['nullable', 'string', 'max:100'],
|
||||
'intermediate_region' => ['nullable', 'string', 'max:255'],
|
||||
'intermediate_region' => ['nullable', 'string', self::MAX_STRING],
|
||||
'sort_order' => ['nullable', 'integer', 'min:0', 'max:999999'],
|
||||
'source' => ['nullable', 'string', 'max:255'],
|
||||
'source_version' => ['nullable', 'string', 'max:255'],
|
||||
'source' => ['nullable', 'string', self::MAX_STRING],
|
||||
'source_version' => ['nullable', 'string', self::MAX_STRING],
|
||||
'last_synced_at' => ['nullable', 'date'],
|
||||
'metadata' => ['nullable', 'json'],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user