|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' => [$settingExists ? 'nullable' : 'required', 'image', 'max:2048'], 'icon' => [$settingExists ? 'nullable' : 'required', 'image', 'max:1024'], ]; } }