Passed
Pull Request — master (#25)
by
unknown
04:11
created

ChequeDetail::createdBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace App;
4
5
use Sofa\Eloquence\Eloquence;
6
use Illuminate\Database\Eloquent\Model;
7
8
class ChequeDetail extends Model
9
{
10
    protected $table = 'trn_cheque_details';
11
12
    protected $fillable = [
13
            'payment_id',
14
            'number',
15
            'date',
16
            'status',
17
            'created_by',
18
            'updated_by',
19
     ];
20
21
    //Eloquence Search mapping
22
    use Eloquence;
23
24
    protected $searchableColumns = [
25
        'number' => 20,
26
    ];
27
28
    public function createdBy()
29
    {
30
        return $this->belongsTo('App\User', 'created_by');
31
    }
32
33
    public function updatedBy()
34
    {
35
        return $this->belongsTo('App\User', 'updated_by');
36
    }
37
38
    public function Payment()
39
    {
40
        return $this->belongsTo('App\PaymentDetail', 'payment_id');
41
    }
42
}
43