git commit "add flight image upload and update support"
This commit is contained in:
@@ -12,7 +12,7 @@ class FlightStoreRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,68 @@ class FlightStoreRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
'airline'=>[
|
||||
'required',
|
||||
'string',
|
||||
'max:100'
|
||||
],
|
||||
'flight_number'=>[
|
||||
'required',
|
||||
'string',
|
||||
'max:50'
|
||||
],
|
||||
'origin'=>[
|
||||
'required',
|
||||
'string',
|
||||
'max:100'
|
||||
],
|
||||
'destination'=>[
|
||||
'required',
|
||||
'string',
|
||||
'max:100'
|
||||
],
|
||||
'departure_date'=>[
|
||||
'required',
|
||||
'date',
|
||||
|
||||
],
|
||||
'departure_time'=>[
|
||||
'required'
|
||||
],
|
||||
'arrival_time'=>[
|
||||
'required'
|
||||
],
|
||||
'flight_class'=>[
|
||||
'nullable',
|
||||
'string',
|
||||
'max:50'
|
||||
],
|
||||
'capacity'=>[
|
||||
'required',
|
||||
'integer',
|
||||
'min:1'
|
||||
],
|
||||
'price'=>[
|
||||
'required',
|
||||
'numeric',
|
||||
'min:0'
|
||||
],
|
||||
'image' => [
|
||||
'nullable',
|
||||
'image',
|
||||
'mimes:jpg,jpeg,png,webp',
|
||||
'max:2048'
|
||||
],
|
||||
'type'=>[
|
||||
'required',
|
||||
'integer',
|
||||
'in:0,2,3'
|
||||
],
|
||||
'status'=>[
|
||||
'required',
|
||||
'in:0,1,2,3,4'
|
||||
]
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user