added countries support expanded for ISO 3166 standard

This commit is contained in:
Mark Gregory
2026-06-15 09:27:57 +01:00
parent 76521e07fe
commit 3638e34535
21 changed files with 771 additions and 50 deletions
@@ -3,20 +3,32 @@
namespace Modules\Countries\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Modules\Countries\Support\Iso3166;
class UpdateCountryRequest extends FormRequest
{
/**
* Authorize country reference-data administration.
*/
public function authorize(): bool
{
return (bool) $this->user();
return (bool) $this->user()?->isMpbaPlatformAdmin();
}
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'display_name' => ['nullable', 'string', 'max:255'],
'is_active' => ['nullable', 'boolean'],
'sort_order' => ['nullable', 'integer', 'min:0', 'max:999999'],
'iso_status' => ['required', 'string', Rule::in(Iso3166::statuses())],
'independent' => ['nullable', 'boolean'],
'region' => ['nullable', 'string', 'max:100'],
'subregion' => ['nullable', 'string', 'max:100'],
];
}
}