phpvms/app/Http/Requests/CreateAirlineRequest.php

23 lines
412 B
PHP
Raw Normal View History

2017-06-09 09:02:52 +08:00
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
2017-06-20 00:50:25 +08:00
use App\Models\Airline;
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
}
}