Files
Wian Drs 60946ddf37
tests / ci (push) Has been cancelled
update lisensi prosess
2026-08-25 13:43:55 +07:00

31 lines
882 B
PHP

<?php
namespace App\Models;
use App\Models\Concerns\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Str;
class BillingOrder extends Model
{
use BelongsToTenant;
protected $fillable = ['tenant_id', 'license_id', 'plan_code', 'gateway', 'payment_method', 'external_id', 'status', 'subtotal', 'tax', 'total', 'currency', 'checkout_url', 'metadata', 'expires_at', 'paid_at'];
protected static function booted(): void
{
static::creating(fn (self $order) => $order->uuid ??= (string) Str::uuid());
}
protected function casts(): array
{
return ['metadata' => 'array', 'expires_at' => 'immutable_datetime', 'paid_at' => 'immutable_datetime'];
}
public function license(): BelongsTo
{
return $this->belongsTo(License::class);
}
}