Deposit   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 35
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A session() 0 3 1
A receivable() 0 3 1
A scopeWhereSession() 0 3 1
1
<?php
2
3
namespace Siak\Tontine\Model;
4
5
use Illuminate\Database\Eloquent\Builder;
6
7
class Deposit extends Base
8
{
9
    /**
10
     * The table associated with the model.
11
     *
12
     * @var string
13
     */
14
    protected $table = 'v_deposits';
15
16
    /**
17
     * Indicates if the model should be timestamped.
18
     *
19
     * @var bool
20
     */
21
    public $timestamps = false;
22
23
    public function session()
24
    {
25
        return $this->belongsTo(Session::class);
26
    }
27
28
    public function receivable()
29
    {
30
        return $this->belongsTo(Receivable::class);
31
    }
32
33
    /**
34
     * @param  Builder  $query
35
     * @param  Session $session
36
     *
37
     * @return Builder
38
     */
39
    public function scopeWhereSession(Builder $query, Session $session): Builder
40
    {
41
        return $query->where('session_id', $session->id);
42
    }
43
}
44