50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CryptoPayment extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'order_id',
|
|
'invoice_id',
|
|
'payment_id',
|
|
'pay_currency',
|
|
'pay_amount',
|
|
'actually_paid',
|
|
'pay_address',
|
|
'price_amount',
|
|
'price_currency',
|
|
'exchange_rate_at_payment',
|
|
'status',
|
|
'confirmations',
|
|
'tx_hash',
|
|
'fee',
|
|
'raw_payload',
|
|
'credited_btx',
|
|
'credited_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'pay_amount' => 'decimal:18',
|
|
'actually_paid' => 'decimal:18',
|
|
'price_amount' => 'decimal:8',
|
|
'exchange_rate_at_payment' => 'decimal:12',
|
|
'fee' => 'decimal:18',
|
|
'tx_hash' => 'array',
|
|
'raw_payload' => 'array',
|
|
'credited_btx' => 'decimal:8',
|
|
'credited_at' => 'datetime',
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|