phpvms/app/Http/Requests/Acars/PrefileRequest.php

62 lines
1.9 KiB
PHP
Raw Normal View History

<?php
namespace App\Http\Requests\Acars;
use App\Contracts\FormRequest;
/**
* Class PrefileRequest
*/
class PrefileRequest extends FormRequest
{
/**
* @return array|void
*/
/*public function sanitize()
{
return Pirep::$sanitize;
}*/
/**
* @return array
*/
public function rules()
{
$rules = [
'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',
2018-09-09 00:38:30 +08:00
'alt_airport_id' => 'nullable',
'status' => 'nullable',
'level' => 'nullable|numeric',
2018-05-01 06:29:42 +08:00
'flight_type' => 'nullable',
'route_code' => 'nullable',
'route_leg' => 'nullable',
'distance' => 'nullable|numeric',
'block_time' => 'nullable|integer',
'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',
'block_off_time' => 'nullable|date',
'block_on_time' => 'nullable|date',
'created_at' => 'nullable|date',
2018-08-27 00:40:04 +08:00
// See if the fare objects are included and formatted properly
'fares' => 'nullable|array',
'fares.*.id' => 'required',
'fares.*.count' => 'required|numeric',
];
return $rules;
}
}