hash = $hash; } /** * Get the current user's profile. * * @return JsonResponse */ public function show(Request $request) { return response()->json($request->user()); } /** * Update the current user's profile. * * @throws RuntimeException * * @return JsonResponse */ public function update(ProfileUpdateRequest $request) { $data = $request->only('name', 'email'); if ($request->password) { $data['password'] = $this->hash->make($request->password); } return response()->json($request->user()->update($data)); } }