NotificationChannel   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A notifications() 0 3 1
1
<?php
2
3
namespace Usamamuneerchaudhary\Notifier\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Relations\HasMany;
7
8
class NotificationChannel extends Model
9
{
10
    protected $table = 'notifier_channels';
11
    protected $fillable = [
12
        'title',
13
        'type',
14
        'icon',
15
        'is_active',
16
        'settings',
17
    ];
18
19
    protected $casts = [
20
        'is_active' => 'boolean',
21
        'settings' => 'array',
22
    ];
23
24
    public function notifications(): HasMany
25
    {
26
        return $this->hasMany(Notification::class, 'channel', 'type');
27
    }
28
}
29