ModelLog::reverter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Djunehor\EventRevert;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
8
class ModelLog extends Model
9
{
10
    protected $fillable = [
11
        'causer_id',
12
        'causer_type',
13
        'subject_id',
14
        'subject_type',
15
        'action',
16
        'description',
17
        'old',
18
        'new',
19
        'route',
20
    ];
21
    use SoftDeletes;
22
23 5
    public function subject()
24
    {
25 5
        return $this->morphTo('subject');
26
    }
27
28 3
    public function causer()
29
    {
30 3
        return $this->morphTo('causer');
31
    }
32
33 3
    public function reverter()
34
    {
35 3
        return $this->morphTo('reverter');
36
    }
37
}
38