hash = $hash; $this->tokenManager = $tokenManager; $this->currentUser = $currentUser; } public function show() { return response()->json($this->currentUser); } public function update(ProfileUpdateRequest $request) { if (config('koel.misc.demo')) { return response()->json(); } $data = $request->only('name', 'email'); if ($request->password) { $data['password'] = $this->hash->make($request->password); } $this->currentUser->update($data); $responseData = $request->password ? ['token' => $this->tokenManager->refreshToken($this->currentUser)->plainTextToken] : []; return response()->json($responseData); } }