Menu   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 43
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A domain() 0 3 1
A initTablePrefix() 0 3 1
A user() 0 3 1
1
<?php
2
3
namespace Uccello\Core\Models;
4
5
use Uccello\Core\Database\Eloquent\Model;
6
7
class Menu extends Model
8
{
9
    /**
10
     * The table associated with the model.
11
     *
12
     * @var string
13
     */
14
    protected $table = 'menus';
15
16
    /**
17
     * The attributes that should be casted to native types.
18
     *
19
     * @var array
20
     */
21
    protected $casts = [
22
        'data' => 'object',
23
    ];
24
25
    /**
26
     * The attributes that are mass assignable.
27
     *
28
     * @var array
29
     */
30
    protected $fillable = [
31
        'domain_id',
32
        'user_id',
33
        'type',
34
        'data',
35
    ];
36
37
    protected function initTablePrefix()
38
    {
39
        $this->tablePrefix = env('UCCELLO_TABLE_PREFIX', 'uccello_');
40
    }
41
42
    public function domain()
43
    {
44
        return $this->belongsTo(Domain::class);
45
    }
46
47
    public function user()
48
    {
49
        return $this->belongsTo(User::class);
50
    }
51
}
52