remove unique on update #214
This commit is contained in:
@@ -5,18 +5,29 @@ namespace App\Http\Requests;
|
||||
use App\Models\Airport;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* Class CreateAirportRequest
|
||||
* @package App\Http\Requests
|
||||
*/
|
||||
class CreateAirportRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = Airport::$rules;
|
||||
$rules['icao'] .= '|unique:airports';
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,21 +9,21 @@ class CreateFareRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
return Fare::$rules;
|
||||
$rules = Fare::$rules;
|
||||
$rules['code'] .= '|unique:fares';
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,21 +9,21 @@ class CreateSubfleetRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
return Subfleet::$rules;
|
||||
$rules = Subfleet::$rules;
|
||||
$rules['type'] .= '|unique:subfleets';
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,24 +9,21 @@ class CreateUserRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = User::$rules;
|
||||
$rules['email'] .= '|unique:users,email';
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user