Completed
Push — master ( c4d057...a4831f )
by ARCANEDEV
07:52
created

Referer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 53
rs 10
c 0
b 0
f 0
ccs 0
cts 6
cp 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A domain() 0 6 1
1
<?php namespace Arcanedev\LaravelTracker\Models;
2
3
/**
4
 * Class     Referer
5
 *
6
 * @package  Arcanedev\LaravelTracker\Models
7
 * @author   ARCANEDEV <[email protected]>
8
 *
9
 * @property  int             id
10
 * @property  int             domain_id
11
 * @property  string          url
12
 * @property  string          host
13
 * @property  string          medium
14
 * @property  string          source
15
 * @property  string          search_terms_hash
16
 * @property  \Carbon\Carbon  created_at
17
 * @property  \Carbon\Carbon  updated_at
18
 *
19
 * @property  \Arcanedev\LaravelTracker\Models\Domain  domain
20
 */
21
class Referer extends Model
22
{
23
    /* ------------------------------------------------------------------------------------------------
24
     |  Properties
25
     | ------------------------------------------------------------------------------------------------
26
     */
27
    /**
28
     * The table associated with the model.
29
     *
30
     * @var string
31
     */
32
    protected $table = 'referers';
33
34
    /**
35
     * The attributes that are mass assignable.
36
     *
37
     * @var array
38
     */
39
    protected $fillable = [
40
        'url',
41
        'host',
42
        'domain_id',
43
        'medium',
44
        'source',
45
        'search_terms_hash',
46
    ];
47
48
    /**
49
     * The attributes that should be cast to native types.
50
     *
51
     * @var array
52
     */
53
    protected $casts = [
54
        'id'        => 'integer',
55
        'domain_id' => 'integer',
56
    ];
57
58
    /* ------------------------------------------------------------------------------------------------
59
     |  Relationships
60
     | ------------------------------------------------------------------------------------------------
61
     */
62
    /**
63
     * Domain relationship.
64
     *
65
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
66
     */
67
    public function domain()
68
    {
69
        return $this->belongsTo(
70
            $this->getConfig('models.domain', Domain::class)
71
        );
72
    }
73
}
74