belongsTo(User::class); } public function currency() { return $this->belongsTo(Currency::class, 'currency_code', 'code'); } public function formattedAmount(): Attribute { return Attribute::make( get: fn () => new Price(['price' => $this->amount, 'currency' => $this->currency]) ); } }