2017-06-09 09:02:52 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
2017-06-20 00:50:25 +08:00
|
|
|
use App\Models\Airline;
|
2018-02-21 12:33:09 +08:00
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
2017-06-09 09:02:52 +08:00
|
|
|
|
2017-06-20 00:50:25 +08:00
|
|
|
class CreateAirlineRequest extends FormRequest
|
2017-06-09 09:02:52 +08:00
|
|
|
{
|
|
|
|
public function authorize()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function rules()
|
|
|
|
{
|
2017-12-31 04:37:10 +08:00
|
|
|
$rules = Airline::$rules;
|
|
|
|
$rules['iata'] .= '|unique:airlines';
|
|
|
|
$rules['icao'] .= '|unique:airlines';
|
|
|
|
return $rules;
|
2017-06-09 09:02:52 +08:00
|
|
|
}
|
|
|
|
}
|