mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 22:44:03 +00:00
Merge branch 'development' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into wallet-ui
# Conflicts: # resources/views/partials/header.blade.php # routes/web.php
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
@@ -17,6 +18,8 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
class Transaction extends AbstractModel implements Documentable
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'transactions';
|
||||
|
||||
public function owner(): morphTo
|
||||
@@ -126,10 +129,15 @@ class Transaction extends AbstractModel implements Documentable
|
||||
|
||||
/**
|
||||
* @param Builder $query
|
||||
* @param string $payment_reference
|
||||
* @return Builder
|
||||
*/
|
||||
public function scopeRefunds(Builder $query)
|
||||
public function scopeRefunds(Builder $query, ?string $payment_reference = NULL)
|
||||
{
|
||||
if($payment_reference){
|
||||
$query->where('payment_reference', $payment_reference);
|
||||
}
|
||||
|
||||
return $query->where('type', TransactionType::REFUND);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user