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

Settlement::scopeWhereSession()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
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