specific user
This commit is contained in:
@@ -209,12 +209,19 @@ class ProfileController extends Controller
|
|||||||
|
|
||||||
DB::transaction(function () use ($profile, $user, $validated) {
|
DB::transaction(function () use ($profile, $user, $validated) {
|
||||||
$profile->update($validated);
|
$profile->update($validated);
|
||||||
$user->update([
|
// this user
|
||||||
|
$profile->user->update([
|
||||||
'name' => $validated['nama'],
|
'name' => $validated['nama'],
|
||||||
'email' => $validated['email'],
|
'email' => $validated['email'],
|
||||||
'email_verified_at' => $validated['email_verified_at'] ?? null,
|
'email_verified_at' => $validated['email_verified_at'] ?? null,
|
||||||
'updated_by' => $user->id,
|
'updated_by' => auth()->id(),
|
||||||
]);
|
]);
|
||||||
|
// $user->update([
|
||||||
|
// 'name' => $validated['nama'],
|
||||||
|
// 'email' => $validated['email'],
|
||||||
|
// 'email_verified_at' => $validated['email_verified_at'] ?? null,
|
||||||
|
// 'updated_by' => $user->id,
|
||||||
|
// ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
return response()->json($profile);
|
return response()->json($profile);
|
||||||
|
|||||||
Reference in New Issue
Block a user