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

Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A info() 0 14 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