|string> */ public function rules(): array { $settingExists = GeneralSetting::exists(); return [ 'name' => ['required', 'string', 'max:50'], 'description' => ['required', 'string'], 'address' => ['required', 'string'], 'phone' => ['required', 'string', 'max:20'], 'logo_light' => [$settingExists ? 'nullable' : 'required', 'image', 'max:2048'], 'logo_dark' => ['nullable', 'image', 'max:2048'], 'icon_light' => [$settingExists ? 'nullable' : 'required', 'image', 'max:1024'], 'icon_dark' => ['nullable', 'image', 'max:1024'], ]; } }