Quellcode durchsuchen

fix: user master

Muhammad Iqbal Afandi vor 3 Jahren
Ursprung
Commit
158d257d9d

+ 1
- 1
app/Http/Controllers/UserController.php Datei anzeigen

200
 
200
 
201
     public function resetPassword(User $user)
201
     public function resetPassword(User $user)
202
     {
202
     {
203
-        $user->update(["password" => bcrypt("12345678")]);
203
+        $user->update(["password" => bcrypt($user->username)]);
204
 
204
 
205
         return back()->with(
205
         return back()->with(
206
             "success",
206
             "success",

+ 2
- 1
app/Http/Requests/User/StoreUserRequest.php Datei anzeigen

25
     {
25
     {
26
         return [
26
         return [
27
             "name" => "required|string|max:50",
27
             "name" => "required|string|max:50",
28
-            "username" => "required|string|min:5",
28
+            "username" =>
29
+                "required|string|regex:/^\S*$/u|min:5|unique:users,username",
29
             "role_id" => "required|numeric",
30
             "role_id" => "required|numeric",
30
         ];
31
         ];
31
     }
32
     }

+ 1
- 1
app/Http/Requests/User/UpdateUserRequest.php Datei anzeigen

26
         return [
26
         return [
27
             "name" => "required|string|max:50",
27
             "name" => "required|string|max:50",
28
             "username" =>
28
             "username" =>
29
-                "required|string|min:5|unique:users,username," .
29
+                "required|string|regex:/^\S*$/u|min:5|unique:users,username," .
30
                 $this->user->id,
30
                 $this->user->id,
31
             "role_id" => "required|numeric",
31
             "role_id" => "required|numeric",
32
         ];
32
         ];