*/ use HasFactory, HasUlids; protected $fillable = [ 'user_id', 'credit_product_id', 'type', 'credits', 'balance_after', 'source', 'stripe_checkout_session_id', 'stripe_invoice_id', 'stripe_payment_intent_id', 'stripe_subscription_id', 'metadata', ]; public function user(): BelongsTo { return $this->belongsTo(User::class); } public function creditProduct(): BelongsTo { return $this->belongsTo(CreditProduct::class); } protected function casts(): array { return [ 'type' => CreditLedgerEntryType::class, 'credits' => 'integer', 'balance_after' => 'integer', 'metadata' => 'array', ]; } }