From 63485d5a0f68d7b942d7faee1ae420d24617fc91 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 1 Aug 2019 13:15:33 -0400 Subject: [PATCH] Make hours and minutes fields required --- app/Http/Requests/CreatePirepRequest.php | 6 +++--- app/Http/Requests/UpdatePirepRequest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Requests/CreatePirepRequest.php b/app/Http/Requests/CreatePirepRequest.php index 9f66d7df..b8d4f22f 100644 --- a/app/Http/Requests/CreatePirepRequest.php +++ b/app/Http/Requests/CreatePirepRequest.php @@ -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'; } diff --git a/app/Http/Requests/UpdatePirepRequest.php b/app/Http/Requests/UpdatePirepRequest.php index 29fd0ebe..56e1530a 100644 --- a/app/Http/Requests/UpdatePirepRequest.php +++ b/app/Http/Requests/UpdatePirepRequest.php @@ -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);