server_id !== $server->id) { throw (new ModelNotFoundException)->setModel(Database::class); } // The action commits its own transaction around the remote user change, so the // activity is logged afterwards instead of wrapping a change it cannot undo. $passwordService->rotate($database); Activity::event('admin:server-database.rotate-password') ->subject($database) ->property('name', $database->database) ->log(); return ServerDatabaseResource::make($database->refresh())->withIncludes('password'); } }