country = (new Customers())->getIsoCountry($customer->country); }); static::updating(function ($customer) { $customer->country = (new Customers())->getIsoCountry($customer->country); }); } private function getIsoCountry($country) { $country = trim(ucfirst(strtolower($country))); switch ($country) { case 'Belgique': return 56; break; case 'Luxembourg': return 442; break; default: return 250; // France } } }