From f7484b754b06713304c7ee3a60e8b867381e5290 Mon Sep 17 00:00:00 2001 From: Stephen Sullivan Date: Tue, 13 Oct 2020 11:44:35 +0100 Subject: [PATCH] Added check for config option to enable/disable uk postcode validation --- src/Models/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Address.php b/src/Models/Address.php index 2bc0b88..a60da6c 100644 --- a/src/Models/Address.php +++ b/src/Models/Address.php @@ -79,7 +79,7 @@ public function validate(): void switch ($this->country->isoCodeAlpha3) { case 'GBR': - if (!Validator::validatePostcode($this->postcode)) { + if (config('addresses.uk_postcode_check.enabled') && !Validator::validatePostcode($this->postcode)) { throw new InvalidUKPostcodeException(); } break;