Completed
Pull Request — master (#133)
by
unknown
05:13
created

Deviceimage::device()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Support\Facades\DB;
7
use Spatie\Activitylog\Traits\LogsActivity;
8
9
class Deviceimage extends Model
10
{
11
    use LogsActivity;
12
    
13
    /**
14
     * The attributes that are mass assignable.
15
     *
16
     * @var array
17
     */
18
    protected $fillable = [
19
        'device_id', 'url'
20
    ];
21
    
22
    /**
23
     * The attributes to ignore in the Activity Log
24
     *
25
     * @var array
26
     */
27
    protected static $ignoreChangedAttributes = [ 'updated_at' ];
28
    
29
    /**
30
     * The attributes to log in the Activity Log
31
     *
32
     * @var array
33
     */
34
    protected static $logAttributes = [
35
        'device_id', 'url'
36
    ];
37
    
38
    /**
39
     * Only log those that have actually changed after the update.
40
     *
41
     * @var array
42
     */
43
    protected static $logOnlyDirty = true;
44
45
    /**
46
     * Get the device for the image.
47
     */
48
    public function device()
49
    {
50
        return $this->belongsTo('App\Device');
51
    }
52
    
53
    /**
54
     * Update the updated_at and created_at timestamps?
55
     *
56
     * @var array
57
     */
58
    public $timestamps = true;
59
}
60