phpvms/app/Http/Requests/UpdateAirlineRequest.php

24 lines
497 B
PHP
Raw Normal View History

2017-06-09 09:02:52 +08:00
<?php
namespace App\Http\Requests;
use App\Contracts\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 UpdateAirlineRequest extends FormRequest
2017-06-09 09:02:52 +08:00
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules(): array
2017-06-09 09:02:52 +08:00
{
$rules = Airline::$rules;
$rules['iata'] .= '|unique:airlines,iata,'.$this->id.',id';
$rules['icao'] .= '|unique:airlines,icao,'.$this->id.',id';
2017-06-20 00:50:25 +08:00
return Airline::$rules;
2017-06-09 09:02:52 +08:00
}
}