Deploy Ladill Care / deploy (push) Failing after 13s
Healthcare management app: patients, appointments, consultations, lab, pharmacy inventory, billing, and reports at care.ladill.com. Co-authored-by: Cursor <cursoragent@cursor.com>
45 lines
961 B
PHP
45 lines
961 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\BelongsToOwner;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Support\Str;
|
|
|
|
class Payment extends Model
|
|
{
|
|
use BelongsToOwner;
|
|
|
|
protected $table = 'care_payments';
|
|
|
|
protected $fillable = [
|
|
'uuid', 'owner_ref', 'bill_id', 'amount_minor', 'method',
|
|
'reference', 'paid_at', 'recorded_by', 'notes',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['paid_at' => 'datetime'];
|
|
}
|
|
|
|
protected static function booted(): void
|
|
{
|
|
static::creating(function (Payment $payment) {
|
|
if (! $payment->uuid) {
|
|
$payment->uuid = (string) Str::uuid();
|
|
}
|
|
});
|
|
}
|
|
|
|
public function getRouteKeyName(): string
|
|
{
|
|
return 'uuid';
|
|
}
|
|
|
|
public function bill(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Bill::class, 'bill_id');
|
|
}
|
|
}
|