Passed
Push — dev6 ( 6e2ff7...b01572 )
by Ron
18:29
created

ChangeUserPasswordRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 6 1
A authorize() 0 3 1
1
<?php
2
3
namespace App\Http\Requests\User;
4
5
use App\Models\User;
6
use Illuminate\Foundation\Http\FormRequest;
7
8
class ChangeUserPasswordRequest extends FormRequest
9
{
10
    /**
11
     * Determine if the user is authorized to make this request
12
     */
13
    public function authorize()
14
    {
15
        return $this->user()->can('create', User::class);
16
    }
17
18
    /**
19
     * Get the validation rules that apply to the request
20
     */
21
    public function rules()
22
    {
23
        return [
24
            'username'  => 'required|exists:users',
25
            'full_name' => 'required|string',
26
            'password'  => 'required|min:6|confirmed',
27
        ];
28
    }
29
}
30