NotifyNewTechTip   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 5 2
1
<?php
2
3
namespace App\Listeners\Notify;
4
5
use Illuminate\Support\Facades\Notification;
6
7
use App\Models\User;
8
use App\Events\TechTips\TechTipCreatedEvent;
9
use App\Notifications\TechTips\NewTechTipNotification;
10
use Illuminate\Contracts\Queue\ShouldQueue;
11
12
class NotifyNewTechTip implements ShouldQueue
13
{
14
    /**
15
     * Handle the event
16
     */
17
    public function handle(TechTipCreatedEvent $event)
18
    {
19
        if($event->notify)
20
        {
21
            Notification::send(User::all(), new NewTechTipNotification($event->techTip));
22
        }
23
    }
24
}
25