fix: update airport management
This commit is contained in:
@@ -14,6 +14,15 @@ class AirportStoreRequest extends FormRequest
|
||||
{
|
||||
return true;
|
||||
}
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
// کد فرودگاه همیشه با حروف بزرگ ذخیره شود (IATA)
|
||||
if ($this->has('code')) {
|
||||
$this->merge([
|
||||
'code' => strtoupper($this->input('code')),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
@@ -35,7 +44,7 @@ class AirportStoreRequest extends FormRequest
|
||||
'string',
|
||||
'max:100'
|
||||
],
|
||||
'country' =>
|
||||
'province' =>
|
||||
[
|
||||
'required',
|
||||
'string',
|
||||
@@ -50,6 +59,16 @@ class AirportStoreRequest extends FormRequest
|
||||
];
|
||||
}
|
||||
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'نام فرودگاه',
|
||||
'city' => 'شهر',
|
||||
'country' => 'کشور',
|
||||
'code' => 'کد فرودگاه',
|
||||
];
|
||||
}
|
||||
|
||||
// public function messages(): array
|
||||
// {
|
||||
// return [
|
||||
|
||||
Reference in New Issue
Block a user