Completed
Push — master ( 9abbc7...a687e5 )
by Fabrizio
03:03
created

NotificationGroup   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A categories() 0 8 1
1
<?php
2
3
namespace Fenos\Notifynder\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class NotificationGroup.
9
 */
10
class NotificationGroup extends Model
11
{
12
    /**
13
     * @var array
14
     */
15
    protected $fillable = ['name'];
16
17
    /**
18
     * @var bool
19
     */
20
    public $timestamps = false;
21
22
    /**
23
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
24
     */
25
    public function categories()
26
    {
27
        return $this->belongsToMany(
28
            'Fenos\Notifynder\Models\NotificationCategory',
29
            'notifications_categories_in_groups',
30
            'group_id', 'category_id'
31
        );
32
    }
33
}
34