Completed
Push — master ( f124f9...19a8e9 )
by wen
04:08
created

Factory::info()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 2
1
<?php
2
3
namespace Sco\ActionLog;
4
5
use Sco\ActionLog\Models\ActionLog;
6
7
class Factory
8
{
9
    public function info($type, $content)
10
    {
11
        $log = new ActionLog();
12
        \Log::info(var_export(auth()->check(), true));
13
14
        $log->user_id = auth()->user()->id;
15
        $log->type = $type;
16
        $log->content = is_array($content) ? json_encode($content) : $content;
17
18
        $log->ip = request()->getClientIp();
19
20
        $log->save();
21
        
22
    }
23
}
24