'datetime', 'meta' => 'array', 'amount_cents' => 'integer', ]; } public function account(): BelongsTo { return $this->belongsTo(Account::class); } public function bookings(): HasMany { return $this->hasMany(Booking::class); } public function activity(): BelongsTo { return $this->belongsTo(Activity::class); } public function type(): BelongsTo { return $this->belongsTo(\App\Models\PaymentType::class); } /** * Accessor to expose decimal amount for JSON serialization and UI convenience. */ protected function amount(): Attribute { return Attribute::get(function () { $cents = (int) ($this->attributes['amount_cents'] ?? 0); return $cents / 100; }); } /** * Mutator to set amount via decimal; stores in cents. */ public function setAmountAttribute($value): void { $this->attributes['amount_cents'] = (int) round(((float) $value) * 100); } }