phpvms/app/Http/Requests/CreateAirportRequest.php

35 lines
628 B
PHP
Raw Normal View History

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