LogUploadedFile::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 2
nc 2
nop 1
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