public static function find($code) { $code = strtoupper($code); $currencies = static::all(); if (isset($currencies[$code])) { return new static($code, $currencies[$code]['numeric'], $currencies[$code]['decimals']); } }
/** * Get the number of decimal places in the payment currency. * * @return integer */ public function getCurrencyDecimalPlaces() { if ($currency = Currency::find($this->getCurrency())) { return $currency->getDecimals(); } return 2; }