2018-01-29 01:12:13 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Acars;
|
|
|
|
|
2018-05-10 01:45:24 +08:00
|
|
|
use App\Interfaces\FormRequest;
|
|
|
|
use App\Models\Pirep;
|
2018-01-29 01:12:13 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class PrefileRequest
|
|
|
|
* @package App\Http\Requests\Acars
|
|
|
|
*/
|
|
|
|
class PrefileRequest extends FormRequest
|
|
|
|
{
|
2018-05-10 01:45:24 +08:00
|
|
|
/**
|
|
|
|
* @return array|void
|
|
|
|
*/
|
|
|
|
/*public function sanitize()
|
2018-01-29 01:12:13 +08:00
|
|
|
{
|
2018-05-10 01:45:24 +08:00
|
|
|
return Pirep::$sanitize;
|
|
|
|
}*/
|
2018-01-29 01:12:13 +08:00
|
|
|
|
2018-05-10 01:45:24 +08:00
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
2018-01-29 01:12:13 +08:00
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
$rules = [
|
2018-03-20 09:50:40 +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',
|
2018-04-05 02:03:10 +08:00
|
|
|
'source_name' => 'required',
|
2018-01-30 08:14:55 +08:00
|
|
|
|
2018-05-04 04:07:16 +08:00
|
|
|
'status' => 'nullable',
|
2018-03-20 09:50:40 +08:00
|
|
|
'level' => 'nullable|numeric',
|
2018-05-01 06:29:42 +08:00
|
|
|
'flight_type' => 'nullable',
|
2018-03-20 09:50:40 +08:00
|
|
|
'route_code' => 'nullable',
|
|
|
|
'route_leg' => 'nullable',
|
|
|
|
'distance' => 'nullable|numeric',
|
2018-03-30 02:42:16 +08:00
|
|
|
'block_time' => 'nullable|integer',
|
2018-03-20 09:50:40 +08:00
|
|
|
'flight_time' => 'nullable|integer',
|
|
|
|
'planned_distance' => 'nullable|numeric',
|
|
|
|
'planned_flight_time' => 'nullable|integer',
|
|
|
|
'zfw' => 'nullable|numeric',
|
|
|
|
'block_fuel' => 'nullable|numeric',
|
|
|
|
'route' => 'nullable',
|
|
|
|
'notes' => 'nullable',
|
2018-04-26 00:56:05 +08:00
|
|
|
'score' => 'nullable|integer',
|
2018-03-30 03:12:25 +08:00
|
|
|
'block_off_time' => 'nullable|date',
|
|
|
|
'block_on_time' => 'nullable|date',
|
2018-03-20 09:50:40 +08:00
|
|
|
'created_at' => 'nullable|date',
|
2018-03-14 23:34:41 +08:00
|
|
|
|
|
|
|
# See if the fare objects are included and formatted properly
|
2018-03-20 09:50:40 +08:00
|
|
|
'fares' => 'nullable|array',
|
|
|
|
'fares.*.id' => 'required',
|
|
|
|
'fares.*.count' => 'required|numeric',
|
2018-01-29 01:12:13 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
return $rules;
|
|
|
|
}
|
|
|
|
}
|