File size: 750 Bytes
89a1081
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Builder;
use App\Traits\Filterable;

class Transaction extends Model
{
    use HasFactory, Notifiable, Filterable;
    const PLUS = '+';
    const MINUS = "-"; 

    protected $fillable = [
        'seller_id', 'user_id', 'payment_method_id', 'amount', 'post_balance', 'transaction_type', 'transaction_number', 'details'
    ];

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function paymentGateway()
    {
    	return $this->belongsTo(PaymentMethod::class, 'payment_method_id');
    }

}