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

NotificationGroup::categories()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 2 Features 1
Metric Value
c 2
b 2
f 1
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
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