2018-01-29 01:12:13 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Acars;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class PrefileRequest
|
|
|
|
* @package App\Http\Requests\Acars
|
|
|
|
*/
|
|
|
|
class PrefileRequest extends FormRequest
|
|
|
|
{
|
|
|
|
public function authorize()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
$rules = [
|
2018-01-31 01:05:14 +08:00
|
|
|
'airline_id' => 'required|exists:airlines,id',
|
|
|
|
'aircraft_id' => 'required|exists:aircraft,id',
|
|
|
|
'flight_number' => 'required',
|
|
|
|
'dpt_airport_id' => 'required',
|
|
|
|
'arr_airport_id' => 'required',
|
|
|
|
'source_name' => 'required|max:25',
|
2018-01-30 08:14:55 +08:00
|
|
|
|
2018-02-21 01:12:50 +08:00
|
|
|
'level' => 'nullable|numeric',
|
2018-01-31 01:05:14 +08:00
|
|
|
'route_code' => 'nullable',
|
|
|
|
'route_leg' => 'nullable',
|
|
|
|
'distance' => 'nullable|numeric',
|
|
|
|
'flight_time' => 'nullable|integer',
|
2018-02-11 06:02:15 +08:00
|
|
|
'planned_distance' => 'nullable|numeric',
|
2018-01-31 01:05:14 +08:00
|
|
|
'planned_flight_time' => 'nullable|integer',
|
|
|
|
'zfw' => 'nullable|numeric',
|
|
|
|
'block_fuel' => 'nullable|numeric',
|
|
|
|
'route' => 'nullable',
|
|
|
|
'notes' => 'nullable',
|
|
|
|
'flight_type' => 'nullable|integer',
|
|
|
|
'created_at' => 'nullable|date',
|
2018-03-14 23:34:41 +08:00
|
|
|
|
|
|
|
# See if the fare objects are included and formatted properly
|
|
|
|
'fares' => 'nullable|array',
|
|
|
|
'fares.*.id' => 'required',
|
|
|
|
'fares.*.count' => 'required|numeric',
|
2018-01-29 01:12:13 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
return $rules;
|
|
|
|
}
|
|
|
|
}
|