LogUploadedFile   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\Home;
4
5
use Illuminate\Support\Facades\Log;
6
use Illuminate\Support\Facades\Auth;
7
use Illuminate\Queue\InteractsWithQueue;
8
use Illuminate\Contracts\Queue\ShouldQueue;
9
10
use App\Events\Home\UploadedFileEvent;
11
12
class LogUploadedFile
13
{
14
    /**
15
     * Handle the event
16
     */
17
    public function handle(UploadedFileEvent $event)
18
    {
19
        $user = Auth::check() ? Auth::user()->username : \Request::ip();
20
21
        Log::info('New file has been uploaded by '.$user.'.  Details - ', $event->file->toArray());
22
    }
23
}
24