From a0b7d890dc72a4075d0a594e38de5cf8650295f5 Mon Sep 17 00:00:00 2001 From: Vedmant Date: Thu, 7 Mar 2024 20:40:38 +0700 Subject: [PATCH] Do not udpate test users email or password --- app/Http/Controllers/UserController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 0477f1e..8243d50 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -82,6 +82,12 @@ public function update(Request $request, User $user) 'password' => 'nullable|min:6|confirmed', ]); + // Do not udpate test users email or password + if (in_array($user->email, ['user@gmail.com', 'admin@gmail.com'])) { + $request->offsetUnset('email'); + $request->offsetUnset('password'); + } + $user->fill($request->only('name', 'email')); if ($request->get('password')) { $user->password = bcrypt($request->get('password'));