'datetime']; } protected static function booted(): void { static::creating(function (Payment $payment) { if (! $payment->uuid) { $payment->uuid = (string) Str::uuid(); } if (! $payment->status) { $payment->status = self::STATUS_PAID; } }); } public function getRouteKeyName(): string { return 'uuid'; } public function bill(): BelongsTo { return $this->belongsTo(Bill::class, 'bill_id'); } public function isPending(): bool { return $this->status === self::STATUS_PENDING; } public function isPaid(): bool { return $this->status === self::STATUS_PAID; } }