Passed
Push — master ( 139939...b4b8e8 )
by Arthur
21:54 queued 17s
created

Proxy   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A user() 0 3 1
1
<?php
2
3
namespace Modules\Proxy\Entities;
4
5
use Foundation\Contracts\Ownable;
6
use Foundation\Traits\ModelFactory;
7
use Foundation\Traits\OwnedByUser;
8
use Jenssegers\Mongodb\Eloquent\SoftDeletes;
9
use Modules\Proxy\Attributes\ProxyAttributes;
10
use Modules\Machine\Entities\Machine;
11
use Modules\Mongo\Abstracts\MongoModel;
12
use Modules\Proxy\Policies\ProxyPolicy;
13
use Modules\User\Entities\User;
14
15
/**
16
 * Class Proxy.
17
 *
18
 * @property string $_id
19
 */
20
class Proxy extends MongoModel implements Ownable, ProxyAttributes
21
{
22
    use OwnedByUser, ModelFactory, SoftDeletes;
23
24
    protected $policies = [
25
        ProxyPolicy::class
26
    ];
27
28
    protected $observers = [
29
30
    ];
31
32
    /**
33
     * @var string
34
     */
35
    protected $collection = 'proxies';
36
37
    /**
38
     * @var array
39
     */
40
    protected $guarded = [];
41
42
    protected $casts = [
43
        'monitor' => 'boolean',
44
    ];
45
46
    protected $dates = [
47
        'created_at',
48
        'updated_at',
49
        'deleted_at',
50
        'last_alive_at',
51
        'last_checked_at'
52
    ];
53
54
    public function user()
55
    {
56
        return $this->belongsTo(User::class);
57
    }
58
59
}
60