60 lines
1.2 KiB
PHP
60 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ShayeganInboundCharge extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'shayegan_inbound_charges';
|
|
|
|
protected $fillable = [
|
|
'customer_id',
|
|
'customer_tafsil',
|
|
'shayegan_number',
|
|
'amount',
|
|
'description',
|
|
'source',
|
|
'status',
|
|
'raw_data',
|
|
'approved_by',
|
|
'approved_at',
|
|
'rejected_by',
|
|
'rejected_at',
|
|
'reject_reason',
|
|
'withdraw_id',
|
|
'transaction_id',
|
|
];
|
|
|
|
protected $casts = [
|
|
'amount' => 'float',
|
|
'approved_at' => 'datetime',
|
|
'rejected_at' => 'datetime',
|
|
'raw_data' => 'array',
|
|
];
|
|
|
|
public function customer()
|
|
{
|
|
return $this->belongsTo(Customer::class, 'customer_id');
|
|
}
|
|
|
|
public function approver()
|
|
{
|
|
return $this->belongsTo(User::class, 'approved_by');
|
|
}
|
|
|
|
public function rejecter()
|
|
{
|
|
return $this->belongsTo(User::class, 'rejected_by');
|
|
}
|
|
|
|
public function withdraw()
|
|
{
|
|
return $this->belongsTo(Withdraw::class, 'withdraw_id');
|
|
}
|
|
}
|
|
|