Completed
Push — master ( 43f0ef...c95e95 )
by
unknown
24s
created

Device   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 31
ccs 0
cts 4
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A location() 0 4 1
A site() 0 4 1
1
<?php
2
3
namespace App;
4
5
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\SoftDeletes;
8
9
class Device extends Model
10
{
11
    use SoftDeletes;
12
    
13
    /**
14
     * The attributes that are mass assignable.
15
     *
16
     * @var array
17
     */
18
    protected $fillable = [
19
        'name', 'location_id'
20
    ];
21
    
22
    public $timestamps = false;
23
    
24
    /**
25
     * Get the location for the device
26
     */
27
    public function location()
28
    {
29
        return $this->belongsTo('App\Location', 'location_id');
30
    }
31
    
32
    /**
33
     * Get the site for the device
34
     */
35
    public function site()
36
    {
37
        return $this->belongsTo('App\Site');
38
    }
39
}
40