From ca98e2c0c585ada306fcd2b3eb86a54fcc509dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Sun, 18 Jul 2021 11:01:37 +0300 Subject: [PATCH] wizard request validation fixed.. --- app/Http/Requests/Wizard/Company.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Requests/Wizard/Company.php b/app/Http/Requests/Wizard/Company.php index a0aa49875..b9baa1aae 100644 --- a/app/Http/Requests/Wizard/Company.php +++ b/app/Http/Requests/Wizard/Company.php @@ -28,8 +28,14 @@ class Company extends FormRequest */ public function rules() { + $logo = 'nullable'; + + if ($this->files->get('logo')) { + $logo = 'mimes:' . config('filesystems.mimes') . '|between:0,' . config('filesystems.max_size') * 1024 . '|dimensions:max_width=1000,max_height=1000'; + } + $rules = [ - 'logo' => 'mimes:' . config('filesystems.mimes') . '|between:0,' . config('filesystems.max_size') * 1024 . '|dimensions:max_width=1000,max_height=1000', + 'logo' => $logo, ]; if (!setting('apps.api_key', false) && !empty($this->request->get('api_key'))) {