NotifyChannelSubscribers   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
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