Route   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A paths() 0 6 1
1
<?php namespace Arcanedev\LaravelTracker\Models;
2
3
use Arcanedev\LaravelTracker\Contracts\Models\Route as RouteContract;
4
use Arcanedev\LaravelTracker\Support\BindingManager;
5
6
/**
7
 * Class     Route
8
 *
9
 * @package  Arcanesoft\Tracker\Models
10
 * @author   ARCANEDEV <[email protected]>
11
 *
12
 * @property  int             id
13
 * @property  string          name
14
 * @property  string          action
15
 * @property  \Carbon\Carbon  created_at
16
 * @property  \Carbon\Carbon  updated_at
17
 *
18
 * @property  \Illuminate\Database\Eloquent\Collection  paths
19
 */
20
class Route extends AbstractModel implements RouteContract
21
{
22
    /* -----------------------------------------------------------------
23
     |  Properties
24
     | -----------------------------------------------------------------
25
     */
26
27
    /**
28
     * The table associated with the model.
29
     *
30
     * @var string
31
     */
32
    protected $table = 'routes';
33
34
    /**
35
     * The attributes that are mass assignable.
36
     *
37
     * @var array
38
     */
39
    protected $fillable = ['name', 'action'];
40
41
    /* -----------------------------------------------------------------
42
     |  Relationships
43
     | -----------------------------------------------------------------
44
     */
45
46
    /**
47
     * Paths relationship.
48
     *
49
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
50
     */
51
    public function paths()
52
    {
53
        return $this->hasMany(
54
            $this->getModelClass(BindingManager::MODEL_ROUTE_PATH, RoutePath::class)
55
        );
56
    }
57
}
58