Make hours and minutes fields required
This commit is contained in:
parent
aa57997ff5
commit
63485d5a0f
@ -39,15 +39,15 @@ class CreatePirepRequest extends FormRequest
|
||||
|
||||
$field_rules = Pirep::$rules;
|
||||
|
||||
$field_rules['hours'] = 'nullable|integer';
|
||||
$field_rules['minutes'] = 'nullable|integer';
|
||||
$field_rules['hours'] = 'required|integer';
|
||||
$field_rules['minutes'] = 'required|integer';
|
||||
|
||||
// Add the validation rules for the custom fields
|
||||
$pirepFieldRepo = app(PirepFieldRepository::class);
|
||||
|
||||
$custom_fields = $pirepFieldRepo->all();
|
||||
foreach ($custom_fields as $field) {
|
||||
Log::info('field:', $field->toArray());
|
||||
// Log::info('field:', $field->toArray());
|
||||
$field_rules[$field->slug] = $field->required ? 'required' : 'nullable';
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,8 @@ class UpdatePirepRequest extends FormRequest
|
||||
|
||||
$field_rules = Pirep::$rules;
|
||||
|
||||
$field_rules['hours'] = 'nullable|integer';
|
||||
$field_rules['minutes'] = 'nullable|integer';
|
||||
$field_rules['hours'] = 'required|integer';
|
||||
$field_rules['minutes'] = 'required|integer';
|
||||
|
||||
// Add the validation rules for the custom fields
|
||||
$pirepFieldRepo = app(PirepFieldRepository::class);
|
||||
|
Loading…
Reference in New Issue
Block a user