diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index b4743fc..8c90e5e 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -40,7 +40,7 @@ public function store(Request $request){ $user->nama_gelar = $request->nama_gelar; $user->email = $request->email; $user->ettd = $request->ettd; - $user->password = Str::random(12); + $user->password = $request->password; if($user->save()){ return redirect()->route('users.index')->with('success','Data Telah Berhasil Disimpan'); @@ -74,8 +74,13 @@ public function update(Request $request){ $user->nama_gelar = $request->nama_gelar; $user->email = $request->email; $user->ettd = $request->ettd; - $user->password = Str::random(12); + if($request->password==""){ + $user->save(); + return redirect()->route('users.index')->with('success','Data Telah Berhasil Diubah'); + } + + $user->password = $request->password; if($user->save()){ return redirect()->route('users.index')->with('success','Data Telah Berhasil Diubah'); } diff --git a/resources/views/user/index.blade.php b/resources/views/user/index.blade.php index 9e7c997..6df2fc8 100644 --- a/resources/views/user/index.blade.php +++ b/resources/views/user/index.blade.php @@ -109,6 +109,8 @@ + + @@ -203,6 +205,8 @@ + +