Passed
Push — main ( 0b6b4a...973494 )
by Thierry
06:50
created

Settlement   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

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