Navigation   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A menus() 0 4 1
A getCacheKeys() 0 7 1
1
<?php
2
3
namespace Yajra\CMS\Entities;
4
5
use Yajra\CMS\Contracts\Cacheable;
6
use Yajra\CMS\Entities\Traits\PublishableTrait;
7
use Illuminate\Database\Eloquent\Model;
8
use Yajra\Auditable\AuditableTrait;
9
10
/**
11
 * @property int id
12
 * @property bool published
13
 * @property \Illuminate\Database\Eloquent\Collection menus
14
 * @property string type
15
 */
16
class Navigation extends Model implements Cacheable
17
{
18
    use AuditableTrait, PublishableTrait;
19
20
    /**
21
     * @var string
22
     */
23
    protected $table = 'navigation';
24
25
    /**
26
     * @var array
27
     */
28
    protected $fillable = ['title', 'type', 'published'];
29
30
    /**
31
     * @return \Illuminate\Database\Eloquent\Relations\HasMany|Menu
32
     */
33
    public function menus()
34
    {
35
        return $this->hasMany(Menu::class);
36
    }
37
38
    /**
39
     * Get list of keys used for caching.
40
     *
41
     * @return array
42
     */
43
    public function getCacheKeys()
44
    {
45
        return [
46
            'navigation.published',
47
            'navigation.all',
48
        ];
49
    }
50
}
51