{$payment->getKeyName()} = $client->generateId($size = 8); }); } /** * @return BelongsTo */ public function user() { return $this->belongsTo(User::class); } /** * @param mixed $value * @param string $locale * @return float */ public function formatToCurrency($value, $locale = 'en_US') { $formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY); return $formatter->formatCurrency($value, $this->currency_code); } }