NotificationChannel::notifications()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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