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

PasswordPolicyController::submitPolicy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
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