NotifyThreadSubscribers::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\NewReply;
8
use Seongbae\Discuss\Notifications\NewReplyNotification;
9
use Auth;
10
11
class NotifyThreadSubscribers
12
{
13
    public function handle(NewReply $event)
14
    {
15
        $subject = $event->getReply()->user->name." replied \"".limitText($event->getReply()->body, 40)."\"";
16
17
        Notification::send($event->getReply()->thread->subscribersExcept, new NewReplyNotification($event->getReply(), $subject));
18
    }
19
}
20