Skip to content

Commit

Permalink
Added check for config option to enable/disable uk postcode validation
Browse files Browse the repository at this point in the history
  • Loading branch information
SteJaySulli committed Oct 13, 2020
1 parent 8a404aa commit f7484b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f7484b7

Please sign in to comment.