Files
WMS/Modules/Countries/Http/Requests/UpdateCountryRequest.php
T

35 lines
980 B
PHP

<?php
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()?->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'],
];
}
}