2017-06-12 00:36:16 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
|
|
use App\Models\Airport;
|
2017-06-24 06:33:18 +08:00
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
2017-06-12 00:36:16 +08:00
|
|
|
|
2018-03-22 01:35:06 +08:00
|
|
|
/**
|
|
|
|
* Class CreateAirportRequest
|
|
|
|
* @package App\Http\Requests
|
|
|
|
*/
|
2017-06-24 06:33:18 +08:00
|
|
|
class CreateAirportRequest extends FormRequest
|
2017-06-12 00:36:16 +08:00
|
|
|
{
|
2018-03-22 01:35:06 +08:00
|
|
|
/**
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function authorize(): bool
|
2017-06-12 00:36:16 +08:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-03-22 01:35:06 +08:00
|
|
|
/**
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules(): array
|
2017-06-12 00:36:16 +08:00
|
|
|
{
|
2017-12-31 04:37:10 +08:00
|
|
|
$rules = Airport::$rules;
|
|
|
|
$rules['icao'] .= '|unique:airports';
|
|
|
|
return $rules;
|
2017-06-12 00:36:16 +08:00
|
|
|
}
|
|
|
|
}
|