Group   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

1 Method

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