NotifyChannelSubscribers::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Seongbae\Discuss\Listeners;
4
5
use Illuminate\Support\Facades\Log;
6
use Notification;
7
use Seongbae\Discuss\Events\NewThread;
8
use Seongbae\Discuss\Notifications\NewThreadNotification;
9
use Auth;
10
11
class NotifyChannelSubscribers
12
{
13
    public function handle(NewThread $event)
14
    {
15
        $subject = 'New discussion started in '.$event->getThread()->channel->name;
16
17
        Notification::send($event->getThread()->channel->subscribersExcept, new NewThreadNotification($event->getThread(), $subject));
18
    }
19
}
20