From efcbba69640b9fb1d584f4014bda4112260fe8f4 Mon Sep 17 00:00:00 2001 From: Marko259 Date: Sun, 4 Aug 2024 17:19:02 +0200 Subject: [PATCH] Fixed validation issue --- app/Http/Controllers/EventController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/EventController.php b/app/Http/Controllers/EventController.php index d556839..dbafbf7 100644 --- a/app/Http/Controllers/EventController.php +++ b/app/Http/Controllers/EventController.php @@ -52,9 +52,9 @@ public function store(Request $request) 'start_date' => 'required|date_format:Y-m-d H:i|after_or_equal:today', 'end_date' => 'required|date_format:Y-m-d H:i|after_or_equal:start_date', 'event_type' => 'integer', - 'recurrence_interval' => 'required_if:event_type,1|integer', - 'recurrence_unit' => 'required_if:event_type,1|string|max:255|not_in:0', - 'recurrence_end_date' => 'required_if:event_type,1|date_format:Y-m-d H:i|after_or_equal:end_date', + 'recurrence_interval' => 'nullable|required_if:event_type,1|integer', + 'recurrence_unit' => 'nullable|required_if:event_type,1|string|max:255', + 'recurrence_end_date' => 'nullable|required_if:event_type,1|date_format:Y-m-d H:i|after_or_equal:end_date', 'image' => 'nullable|image|mimes:jpeg,jpg,png|max:2048', ]); @@ -143,9 +143,9 @@ public function update(Request $request, Event $event) 'start_date' => 'required|date_format:Y-m-d H:i|after_or_equal:today', 'end_date' => 'required|date_format:Y-m-d H:i|after_or_equal:start_date', 'event_type' => 'integer', - 'recurrence_interval' => 'required_if:event_type,1|integer', - 'recurrence_unit' => 'required_if:event_type,1|string|max:255|not_in:0', - 'recurrence_end_date' => 'required_if:event_type,1|date_format:Y-m-d H:i|after_or_equal:end_date', + 'recurrence_interval' => 'nullable|required_if:event_type,1|integer', + 'recurrence_unit' => 'nullable|required_if:event_type,1|string|max:255', + 'recurrence_end_date' => 'nullable|required_if:event_type,1|date_format:Y-m-d H:i|after_or_equal:end_date', 'image' => 'nullable|image|mimes:jpeg,jpg,png|max:2048', ]);