Completed
Push — master ( 70421f...8ae839 )
by ARCANEDEV
08:37
created

Route::paths()   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     Route
5
 *
6
 * @package  Arcanesoft\Tracker\Models
7
 * @author   ARCANEDEV <[email protected]>
8
 *
9
 * @property  int             id
10
 * @property  string          name
11
 * @property  string          action
12
 * @property  \Carbon\Carbon  created_at
13
 * @property  \Carbon\Carbon  updated_at
14
 */
15
class Route extends AbstractModel
16
{
17
    /* ------------------------------------------------------------------------------------------------
18
     |  Properties
19
     | ------------------------------------------------------------------------------------------------
20
     */
21
    /**
22
     * The table associated with the model.
23
     *
24
     * @var string
25
     */
26
    protected $table = 'routes';
27
28
    /**
29
     * The attributes that are mass assignable.
30
     *
31
     * @var array
32
     */
33
    protected $fillable = ['name', 'action'];
34
35
    /* ------------------------------------------------------------------------------------------------
36
     |  Relationships
37
     | ------------------------------------------------------------------------------------------------
38
     */
39
    /**
40
     * Paths relationship.
41
     *
42
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
43
     */
44
    public function paths()
45
    {
46
        return $this->hasMany(
47
            $this->getConfig('models.route-path', RoutePath::class)
48
        );
49
    }
50
}
51