---
title: "Discussion on \"Create api for user on Pterodactyl\" | Hashnode"
description: "Discussion on \"Create api for user on Pterodactyl\". In ApiKeyController add:\npublic function storeforuser(StoreApiKeyRequest $request, int $userId): array\n    {\n        $user = User::find($userId);\n        if (!$user) {\n            throw new DisplayException('User not found.');\n        }   \n        if..."
url: "https://hashnode.com/posts/create-api-for-user-on-pterodactyl/6874bc4dcc89820141d89670"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Create api for user on Pterodactyl](https://cbm.dev/create-api-for-user-on-pterodactyl?utm_source=hashnode&utm_medium=feed)

In ApiKeyController add: public function storeforuser(StoreApiKeyRequest $request, int $userId): array { $user = User::find($userId); if (!$user) { throw new DisplayException('User not found.'); } if...

Jul 14, 2025 · 1 min read · cbm.dev  
Read the article

-   [#pterodactyl](https://hashnode.com/tag/pterodactyl)

## Written by

[Christian Buchhave Mortensen](https://hashnode.com/@cbmdk)

@cbmdk

  
[View profile](https://hashnode.com/@cbmdk)

dad, developer and techie

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
