Passed
Push — master ( 3a5738...0534b0 )
by Quetzy
03:08
created

Audit::auditable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the Laravel Auditing package.
4
 *
5
 * @author     Antério Vieira <[email protected]>
6
 * @author     Quetzy Garcia  <[email protected]>
7
 * @author     Raphael França <[email protected]>
8
 * @copyright  2015-2018
9
 *
10
 * For the full copyright and license information,
11
 * please view the LICENSE.md file that was distributed
12
 * with this source code.
13
 */
14
15
namespace OwenIt\Auditing\Models;
16
17
use Illuminate\Database\Eloquent\Model;
18
use Illuminate\Database\Eloquent\Relations\MorphTo;
19
20
class Audit extends Model implements \OwenIt\Auditing\Contracts\Audit
21
{
22
    use \OwenIt\Auditing\Audit;
0 ignored issues
show
introduced by
The trait OwenIt\Auditing\Audit requires some properties which are not provided by OwenIt\Auditing\Models\Audit: $new_values, $url, $event, $auditable, $tags, $old_values, $user_agent, $ip_address, $user
Loading history...
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected $guarded = [];
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    protected $casts = [
33
        'old_values'    => 'json',
34
        'new_values'    => 'json',
35
        'auditable_id'  => 'integer',
36
    ];
37
38
    /**
39
     * {@inheritdoc}
40
     */
41 36
    public function auditable(): MorphTo
42
    {
43 36
        return $this->morphTo();
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49 48
    public function user(): MorphTo
50
    {
51 48
        return $this->morphTo();
52
    }
53
}
54