Completed
Push — master ( 3f6bda...9e3353 )
by Joao
03:40
created

Group   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 39
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A users() 0 4 1
A menus() 0 4 1
1
<?php
2
3
namespace jlourenco\base\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Cartalyst\Sentinel\Permissions\PermissibleInterface;
7
use Cartalyst\Sentinel\Permissions\PermissibleTrait;
8
9
class Group extends \Cartalyst\Sentinel\Roles\EloquentRole
10
{
11
12
    /**
13
     * {@inheritDoc}
14
     */
15
    protected $table = 'Group';
16
17
    /**
18
     * {@inheritDoc}
19
     */
20
    protected $fillable = [
21
        'name',
22
        'slug',
23
        'permissions',
24
        'description',
25
    ];
26
27
    /**
28
     * The Users relationship.
29
     *
30
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
31
     */
32
    public function users()
33
    {
34
        return $this->belongsToMany(static::$usersModel, 'Group_User', 'group', 'user')->withTimestamps();
35
    }
36
37
    /**
38
     * The Menus relationship.
39
     *
40
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
41
     */
42
    public function menus()
43
    {
44
        return $this->belongsToMany('App\Menu', 'Menu_Group', 'group', 'menu')->withTimestamps();
45
    }
46
47
}
48