feat: add withdraw request functionality and UI components
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\WalletTransactionReasonEnum;
|
||||
use App\Enums\WalletTransactionTypeEnum;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class WalletTransaction extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'type',
|
||||
'reason',
|
||||
'amount',
|
||||
'balance_after',
|
||||
'description',
|
||||
'wallet_id',
|
||||
'invoice_id',
|
||||
'payment_id',
|
||||
'withdraw_request_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'type' => WalletTransactionTypeEnum::class,
|
||||
'reason' => WalletTransactionReasonEnum::class,
|
||||
'amount' => 'integer',
|
||||
'balance_after' => 'integer',
|
||||
'wallet_id' => 'integer',
|
||||
'invoice_id' => 'integer',
|
||||
'payment_id' => 'integer',
|
||||
'withdraw_request_id' => 'integer',
|
||||
];
|
||||
|
||||
public function wallet()
|
||||
{
|
||||
return $this->belongsTo(Wallet::class);
|
||||
}
|
||||
|
||||
public function invoice()
|
||||
{
|
||||
return $this->belongsTo(Invoice::class);
|
||||
}
|
||||
|
||||
public function payment()
|
||||
{
|
||||
return $this->belongsTo(Payment::class);
|
||||
}
|
||||
|
||||
public function withdrawRequest()
|
||||
{
|
||||
return $this->belongsTo(WithdrawRequest::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user