'decimal:2', 'paid_at' => 'datetime', 'status' => PaymentStatus::class, ]; } public function registerMediaCollections(): void { $this->addMediaCollection('payment_proof')->singleFile(); } public function invoice(): BelongsTo { return $this->belongsTo(TuitionInvoice::class, 'invoice_id'); } public function recorder(): BelongsTo { return $this->belongsTo(User::class, 'recorded_by'); } protected function proofUrl(): Attribute { return Attribute::make( get: fn () => $this->getFirstMediaUrl('payment_proof') ?: null, ); } protected function proofName(): Attribute { return Attribute::make( get: fn () => $this->getFirstMedia('payment_proof')?->file_name, ); } }