Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | 4 | public function rules() |
|
27 | { |
||
28 | return [ |
||
29 | 4 | 'user_id' => 'required|exists:users', |
|
30 | 4 | 'role_id' => 'required|numeric|exists:user_role_types,role_id', |
|
31 | 'username' => [ |
||
32 | 4 | 'required', |
|
33 | 4 | 'regex:/^[a-zA-Z0-9_]*$/', |
|
34 | 4 | Rule::unique('users')->ignore(User::findOrFail($this->request->get('user_id'))), |
|
35 | ], |
||
36 | 4 | 'first_name' => 'required|string', |
|
37 | 4 | 'last_name' => 'required|string', |
|
38 | 'email' => [ |
||
39 | 4 | 'required', |
|
40 | 4 | 'email', |
|
41 | 4 | Rule::unique('users')->ignore(User::findOrFail($this->request->get('user_id'))), |
|
42 | ], |
||
46 |