cleanup validation rules
This commit is contained in:
@@ -7,24 +7,16 @@ use App\Models\Airline;
|
||||
|
||||
class CreateAirlineRequest extends FormRequest
|
||||
{
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return Airline::$rules;
|
||||
$rules = Airline::$rules;
|
||||
$rules['iata'] .= '|unique:airlines';
|
||||
$rules['icao'] .= '|unique:airlines';
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,24 +7,15 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateAirportRequest extends FormRequest
|
||||
{
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return Airport::$rules;
|
||||
$rules = Airport::$rules;
|
||||
$rules['icao'] .= '|unique:airports';
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user