public function rules(): array 	{ 		// if not logged in then invoice_name, email are required 		$rules_user = [];  		if (!auth()->user()) { 			$rules_user = [ 				'invoice_name' => ['required', 'string', 'max:50'], 				'email' => ['required', 'string', 'email', 'max:50'], 			]; 		}  		return array_merge($rules_user, [ 			'delivery_name' => ['nullable', 'string', 'max:50'], 			'r1' => ['boolean'], 			'company_name' => ['required_if:r1,true', 'string', 'max:50'], 			'company_oib' => ['required_if:r1,true', 'string', 'max:11'], 			'company_address' => ['required_if:r1,true', 'string', 'max:100'], 			'items' => ['required', 'array', 'min:1', new ProductsExist], 			'items.*' => ['required', 'numeric', 'min:1'], 			'shipping_provider' => ['required', new Enum(ShippingProvider::class)], 			'delivery_note' => ['nullable', 'string', 'max:1000'], 			'invoice_country_code' => ['required', 'string', 'max:10'], 			'invoice_street' => ['required', 'string', 'max:150'], 			'invoice_city' => ['required', 'string', 'max:50'], 			'invoice_zip_code' => ['required', 'string', 'max:10'], 			'invoice_phone' => ['nullable', 'string', 'max:20'], 			'use_invoice_as_delivery' => ['required', 'boolean'], 			'delivery_country_code' => ['required_if:use_invoice_as_delivery,false', 'string', 'max:10'], 			'delivery_street' => ['required_if:use_invoice_as_delivery,false', 'string', 'max:150'], 			'delivery_city' => ['required_if:use_invoice_as_delivery,false', 'string', 'max:50'], 			'delivery_zip_code' => ['required_if:use_invoice_as_delivery,false', 'string', 'max:10'], 			'delivery_phone' => ['nullable', 'string', 'max:20'], 		]); 	}