Passed
Push — dev5a ( d46f4b...f24c41 )
by Ron
07:14
created

PasswordPolicyController::submitPasswordPolicy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
namespace App\Http\Controllers\Admin;
4
5
use App\Http\Controllers\Controller;
6
7
use Illuminate\Support\Facades\Log;
8
use Illuminate\Support\Facades\Auth;
9
10
use App\Domains\Admin\PasswordPolicy;
11
12
use App\Http\Requests\Admin\PasswordPolicyRequest;
13
14
class PasswordPolicyController extends Controller
15
{
16 2
    public function submitPolicy(PasswordPolicyRequest $request)
17
    {
18 2
        (new PasswordPolicy)->setPolicy($request);
19 2
        Log::notice('User '.Auth::user()->full_name.' updated User Password Policy requiring resets every '.$request->expire.' days');
20
21 2
        return response()->json(['success' => true]);
22
    }
23
}
24