Blueprint dbGet arguments

Hi, I want to store pterodactyl user ID in a database to login. Here is how I'm doing it now:
public function userInfo() {
$pterodactylUser = auth()->user();

if (!$pterodactylUser) {
return response()->json(['error' => 'Unauthorized'], 401);
}

$discordUserId = $this->blueprint->dbGet('discord_auth', 'user:id', $pterodactylUser->id);

if (!$discordUserId) {
return response()->json(['error' => 'No Discord account linked.'], 404);
}

return response()->json([
'username' => $this->blueprint->dbGet('discord_auth', 'user:username', $discordUserId),
'id' => $discordUserId,
'email' => $this->blueprint->dbGet('discord_auth', 'user:email', $discordUserId),
'avatar' => $this->blueprint->dbGet('discord_auth', 'user:avatar', $discordUserId)
]);
}
public function userInfo() {
$pterodactylUser = auth()->user();

if (!$pterodactylUser) {
return response()->json(['error' => 'Unauthorized'], 401);
}

$discordUserId = $this->blueprint->dbGet('discord_auth', 'user:id', $pterodactylUser->id);

if (!$discordUserId) {
return response()->json(['error' => 'No Discord account linked.'], 404);
}

return response()->json([
'username' => $this->blueprint->dbGet('discord_auth', 'user:username', $discordUserId),
'id' => $discordUserId,
'email' => $this->blueprint->dbGet('discord_auth', 'user:email', $discordUserId),
'avatar' => $this->blueprint->dbGet('discord_auth', 'user:avatar', $discordUserId)
]);
}
But it always retourning me the same datas. Even if pterodactylUser is an other is different. Pls ping me when answering
1 Reply
Athenox
AthenoxOP11mo ago
Fixed

Did you find this page helpful?