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

Domain::referers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
ccs 0
cts 6
cp 0
cc 1
eloc 3
nc 1
nop 0
crap 2
1
<?php namespace Arcanedev\LaravelTracker\Models;
2
3
/**
4
 * Class     Domain
5
 *
6
 * @package  Arcanedev\LaravelTracker\Models
7
 * @author   ARCANEDEV <[email protected]>
8
 *
9
 * @property  int             id
10
 * @property  string          name
11
 * @property  \Carbon\Carbon  created_at
12
 * @property  \Carbon\Carbon  updated_at
13
 *
14
 * @property  \Illuminate\Database\Eloquent\Collection  referers
15
 */
16
class Domain extends Model
17
{
18
    /* ------------------------------------------------------------------------------------------------
19
     |  Properties
20
     | ------------------------------------------------------------------------------------------------
21
     */
22
    /**
23
     * The table associated with the model.
24
     *
25
     * @var string
26
     */
27
    protected $table = 'domains';
28
29
    /**
30
     * The attributes that are mass assignable.
31
     *
32
     * @var array
33
     */
34
    protected $fillable = ['name'];
35
36
    /**
37
     * The attributes that should be cast to native types.
38
     *
39
     * @var array
40
     */
41
    protected $casts = [
42
        'id' => 'integer',
43
    ];
44
45
    /* ------------------------------------------------------------------------------------------------
46
     |  Relationships
47
     | ------------------------------------------------------------------------------------------------
48
     */
49
    /**
50
     * Referer relationship.
51
     *
52
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
53
     */
54
    public function referers()
55
    {
56
        return $this->hasMany(
57
            $this->getConfig('models.referer', Referer::class)
58
        );
59
    }
60
}
61