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

PasswordPolicyController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A submitPolicy() 0 6 1
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