From e63cd1837f75c20f727d59e4bcd2babfbd05afdc Mon Sep 17 00:00:00 2001 From: DaneEveritt Date: Fri, 5 Dec 2025 11:18:10 -0800 Subject: [PATCH] Update models to declare their return types on relationships --- app/Models/ActivityLog.php | 9 +++++++++ app/Models/ActivityLogSubject.php | 12 +++++++++-- app/Models/Allocation.php | 4 ++++ app/Models/ApiKey.php | 4 ++++ app/Models/AuditLog.php | 6 ++++++ app/Models/Backup.php | 3 +++ app/Models/Database.php | 4 ++++ app/Models/DatabaseHost.php | 4 ++++ app/Models/Egg.php | 10 ++++++++++ app/Models/EggVariable.php | 5 +++++ app/Models/Location.php | 4 ++++ app/Models/Mount.php | 6 ++++++ app/Models/Nest.php | 4 ++++ app/Models/Node.php | 9 +++++++++ app/Models/RecoveryToken.php | 3 +++ app/Models/Schedule.php | 4 ++++ app/Models/Server.php | 33 ++++++++++++++++++++++++++++++- app/Models/ServerTransfer.php | 6 ++++++ app/Models/ServerVariable.php | 4 ++++ app/Models/Subuser.php | 6 ++++++ app/Models/Task.php | 6 +++++- app/Models/User.php | 15 ++++++++++++++ app/Models/UserSSHKey.php | 3 +++ 23 files changed, 160 insertions(+), 4 deletions(-) diff --git a/app/Models/ActivityLog.php b/app/Models/ActivityLog.php index 5c9ce6efd..13d347138 100644 --- a/app/Models/ActivityLog.php +++ b/app/Models/ActivityLog.php @@ -82,6 +82,9 @@ class ActivityLog extends Model 'properties' => ['array'], ]; + /** + * @return \Illuminate\Database\Eloquent\Relations\MorphTo<\Illuminate\Database\Eloquent\Model, $this> + */ public function actor(): MorphTo { $morph = $this->morphTo(); @@ -92,11 +95,17 @@ class ActivityLog extends Model return $morph; } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\ActivityLogSubject, $this> + */ public function subjects(): HasMany { return $this->hasMany(ActivityLogSubject::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasOne<\Pterodactyl\Models\ApiKey, $this> + */ public function apiKey(): HasOne { return $this->hasOne(ApiKey::class, 'id', 'api_key_id'); diff --git a/app/Models/ActivityLogSubject.php b/app/Models/ActivityLogSubject.php index aabeb0ad2..d1747202a 100644 --- a/app/Models/ActivityLogSubject.php +++ b/app/Models/ActivityLogSubject.php @@ -3,6 +3,8 @@ namespace Pterodactyl\Models; use Illuminate\Database\Eloquent\Relations\Pivot; +use Illuminate\Database\Eloquent\Relations\MorphTo; +use Illuminate\Database\Eloquent\Relations\BelongsTo; /** * \Pterodactyl\Models\ActivityLogSubject. @@ -29,12 +31,18 @@ class ActivityLogSubject extends Pivot protected $guarded = ['id']; - public function activityLog() + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\ActivityLog, $this> + */ + public function activityLog(): BelongsTo { return $this->belongsTo(ActivityLog::class); } - public function subject() + /** + * @return \Illuminate\Database\Eloquent\Relations\MorphTo<\Illuminate\Database\Eloquent\Model, $this> + */ + public function subject(): MorphTo { $morph = $this->morphTo(); if (method_exists($morph, 'withTrashed')) { diff --git a/app/Models/Allocation.php b/app/Models/Allocation.php index cf0775008..0f9bcae1f 100644 --- a/app/Models/Allocation.php +++ b/app/Models/Allocation.php @@ -114,6 +114,8 @@ class Allocation extends Model /** * Gets information for the server associated with this allocation. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Server, $this> */ public function server(): BelongsTo { @@ -122,6 +124,8 @@ class Allocation extends Model /** * Return the Node model associated with this allocation. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Node, $this> */ public function node(): BelongsTo { diff --git a/app/Models/ApiKey.php b/app/Models/ApiKey.php index 4a6f1b65b..3908eed53 100644 --- a/app/Models/ApiKey.php +++ b/app/Models/ApiKey.php @@ -161,6 +161,8 @@ class ApiKey extends Model /** * Returns the user this token is assigned to. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\User, $this> */ public function user(): BelongsTo { @@ -170,6 +172,8 @@ class ApiKey extends Model /** * Required for support with Laravel Sanctum. * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\User, $this> + * * @see \Laravel\Sanctum\Guard::supportsTokens() */ public function tokenable(): BelongsTo diff --git a/app/Models/AuditLog.php b/app/Models/AuditLog.php index ed5c884be..49013f54c 100644 --- a/app/Models/AuditLog.php +++ b/app/Models/AuditLog.php @@ -39,11 +39,17 @@ class AuditLog extends Model 'created_at', ]; + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\User, $this> + */ public function user(): BelongsTo { return $this->belongsTo(User::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Server, $this> + */ public function server(): BelongsTo { return $this->belongsTo(Server::class); diff --git a/app/Models/Backup.php b/app/Models/Backup.php index 9b546ba28..6b44b5058 100644 --- a/app/Models/Backup.php +++ b/app/Models/Backup.php @@ -72,6 +72,9 @@ class Backup extends Model 'upload_id' => 'nullable|string', ]; + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Server, $this> + */ public function server(): BelongsTo { return $this->belongsTo(Server::class); diff --git a/app/Models/Database.php b/app/Models/Database.php index c6a06c365..fa6d91112 100644 --- a/app/Models/Database.php +++ b/app/Models/Database.php @@ -94,6 +94,8 @@ class Database extends Model /** * Gets the host database server associated with a database. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\DatabaseHost, $this> */ public function host(): BelongsTo { @@ -102,6 +104,8 @@ class Database extends Model /** * Gets the server associated with a database. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Server, $this> */ public function server(): BelongsTo { diff --git a/app/Models/DatabaseHost.php b/app/Models/DatabaseHost.php index f48999831..4cc964103 100644 --- a/app/Models/DatabaseHost.php +++ b/app/Models/DatabaseHost.php @@ -71,6 +71,8 @@ class DatabaseHost extends Model /** * Gets the node associated with a database host. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Node, $this> */ public function node(): BelongsTo { @@ -79,6 +81,8 @@ class DatabaseHost extends Model /** * Gets the databases associated with this host. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Database, $this> */ public function databases(): HasMany { diff --git a/app/Models/Egg.php b/app/Models/Egg.php index 08a281ce1..7d7b938f9 100644 --- a/app/Models/Egg.php +++ b/app/Models/Egg.php @@ -263,6 +263,8 @@ class Egg extends Model /** * Gets nest associated with an egg. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Nest, $this> */ public function nest(): BelongsTo { @@ -271,6 +273,8 @@ class Egg extends Model /** * Gets all servers associated with this egg. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Server, $this> */ public function servers(): HasMany { @@ -279,6 +283,8 @@ class Egg extends Model /** * Gets all variables associated with this egg. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\EggVariable, $this> */ public function variables(): HasMany { @@ -287,6 +293,8 @@ class Egg extends Model /** * Get the parent egg from which to copy scripts. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function scriptFrom(): BelongsTo { @@ -295,6 +303,8 @@ class Egg extends Model /** * Get the parent egg from which to copy configuration settings. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function configFrom(): BelongsTo { diff --git a/app/Models/EggVariable.php b/app/Models/EggVariable.php index 887adc795..f30bbc876 100644 --- a/app/Models/EggVariable.php +++ b/app/Models/EggVariable.php @@ -84,6 +84,9 @@ class EggVariable extends Model return in_array('required', explode('|', $this->rules)); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasOne<\Pterodactyl\Models\Egg, $this> + */ public function egg(): HasOne { return $this->hasOne(Egg::class); @@ -91,6 +94,8 @@ class EggVariable extends Model /** * Return server variables associated with this variable. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\ServerVariable, $this> */ public function serverVariable(): HasMany { diff --git a/app/Models/Location.php b/app/Models/Location.php index 656d6ce01..b083d7b2b 100644 --- a/app/Models/Location.php +++ b/app/Models/Location.php @@ -51,6 +51,8 @@ class Location extends Model /** * Gets the nodes in a specified location. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Node, $this> */ public function nodes(): HasMany { @@ -59,6 +61,8 @@ class Location extends Model /** * Gets the servers within a given location. + * + * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough<\Pterodactyl\Models\Server, \Pterodactyl\Models\Node, $this> */ public function servers(): HasManyThrough { diff --git a/app/Models/Mount.php b/app/Models/Mount.php index 475b3cb7f..89c21187b 100644 --- a/app/Models/Mount.php +++ b/app/Models/Mount.php @@ -94,6 +94,8 @@ class Mount extends Model /** * Returns all eggs that have this mount assigned. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<\Pterodactyl\Models\Egg, $this> */ public function eggs(): BelongsToMany { @@ -102,6 +104,8 @@ class Mount extends Model /** * Returns all nodes that have this mount assigned. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<\Pterodactyl\Models\Node, $this> */ public function nodes(): BelongsToMany { @@ -110,6 +114,8 @@ class Mount extends Model /** * Returns all servers that have this mount assigned. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<\Pterodactyl\Models\Server, $this> */ public function servers(): BelongsToMany { diff --git a/app/Models/Nest.php b/app/Models/Nest.php index 22582fdd4..e38b0e63c 100644 --- a/app/Models/Nest.php +++ b/app/Models/Nest.php @@ -48,6 +48,8 @@ class Nest extends Model /** * Gets all eggs associated with this service. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Egg, $this> */ public function eggs(): HasMany { @@ -56,6 +58,8 @@ class Nest extends Model /** * Gets all servers associated with this nest. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Server, $this> */ public function servers(): HasMany { diff --git a/app/Models/Node.php b/app/Models/Node.php index fdb1a43e9..7539219b2 100644 --- a/app/Models/Node.php +++ b/app/Models/Node.php @@ -194,6 +194,9 @@ class Node extends Model return $this->maintenance_mode; } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough<\Pterodactyl\Models\Mount, \Pterodactyl\Models\MountNode, $this> + */ public function mounts(): HasManyThrough { return $this->hasManyThrough(Mount::class, MountNode::class, 'node_id', 'id', 'id', 'mount_id'); @@ -201,6 +204,8 @@ class Node extends Model /** * Gets the location associated with a node. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Location, $this> */ public function location(): BelongsTo { @@ -209,6 +214,8 @@ class Node extends Model /** * Gets the servers associated with a node. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Server, $this> */ public function servers(): HasMany { @@ -217,6 +224,8 @@ class Node extends Model /** * Gets the allocations associated with a node. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Allocation, $this> */ public function allocations(): HasMany { diff --git a/app/Models/RecoveryToken.php b/app/Models/RecoveryToken.php index cb64a6886..64b3b9fad 100644 --- a/app/Models/RecoveryToken.php +++ b/app/Models/RecoveryToken.php @@ -26,6 +26,9 @@ class RecoveryToken extends Model 'token' => 'required|string', ]; + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\User, $this> + */ public function user(): BelongsTo { return $this->belongsTo(User::class); diff --git a/app/Models/Schedule.php b/app/Models/Schedule.php index 3124b7887..b8162e515 100644 --- a/app/Models/Schedule.php +++ b/app/Models/Schedule.php @@ -133,6 +133,8 @@ class Schedule extends Model /** * Return tasks belonging to a schedule. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Task, $this> */ public function tasks(): HasMany { @@ -141,6 +143,8 @@ class Schedule extends Model /** * Return the server model that a schedule belongs to. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Server, $this> */ public function server(): BelongsTo { diff --git a/app/Models/Server.php b/app/Models/Server.php index 8c89b85d8..0350fdf3f 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -219,6 +219,8 @@ class Server extends Model /** * Gets the user who owns the server. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\User, $this> */ public function user(): BelongsTo { @@ -227,6 +229,8 @@ class Server extends Model /** * Gets the subusers associated with a server. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Subuser, $this> */ public function subusers(): HasMany { @@ -235,6 +239,8 @@ class Server extends Model /** * Gets the default allocation for a server. + * + * @return \Illuminate\Database\Eloquent\Relations\HasOne<\Pterodactyl\Models\Allocation, $this> */ public function allocation(): HasOne { @@ -243,6 +249,8 @@ class Server extends Model /** * Gets all allocations associated with this server. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Allocation, $this> */ public function allocations(): HasMany { @@ -251,6 +259,8 @@ class Server extends Model /** * Gets information for the nest associated with this server. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Nest, $this> */ public function nest(): BelongsTo { @@ -259,6 +269,8 @@ class Server extends Model /** * Gets information for the egg associated with this server. + * + * @return \Illuminate\Database\Eloquent\Relations\HasOne<\Pterodactyl\Models\Egg, $this> */ public function egg(): HasOne { @@ -267,6 +279,8 @@ class Server extends Model /** * Gets information for the service variables associated with this server. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\EggVariable, $this> */ public function variables(): HasMany { @@ -285,6 +299,8 @@ class Server extends Model /** * Gets information for the node associated with this server. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Node, $this> */ public function node(): BelongsTo { @@ -293,6 +309,8 @@ class Server extends Model /** * Gets information for the tasks associated with this server. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Schedule, $this> */ public function schedules(): HasMany { @@ -301,6 +319,8 @@ class Server extends Model /** * Gets all databases associated with a server. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Database, $this> */ public function databases(): HasMany { @@ -310,21 +330,28 @@ class Server extends Model /** * Returns the location that a server belongs to. * + * @return \Znck\Eloquent\Relations\BelongsToThrough<\Pterodactyl\Models\Location, \Pterodactyl\Models\Node> + * * @throws \Exception */ public function location(): \Znck\Eloquent\Relations\BelongsToThrough { - return $this->belongsToThrough(Location::class, Node::class); + return $this->belongsToThrough(Location::class, Node::class); // @phpstan-ignore return.type } /** * Returns the associated server transfer. + * + * @return \Illuminate\Database\Eloquent\Relations\HasOne<\Pterodactyl\Models\ServerTransfer, $this> */ public function transfer(): HasOne { return $this->hasOne(ServerTransfer::class)->whereNull('successful')->orderByDesc('id'); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Backup, $this> + */ public function backups(): HasMany { return $this->hasMany(Backup::class); @@ -332,6 +359,8 @@ class Server extends Model /** * Returns all mounts that have this server has mounted. + * + * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough<\Pterodactyl\Models\Mount, \Pterodactyl\Models\MountServer, $this> */ public function mounts(): HasManyThrough { @@ -340,6 +369,8 @@ class Server extends Model /** * Returns all of the activity log entries where the server is the subject. + * + * @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\Pterodactyl\Models\ActivityLog, $this> */ public function activity(): MorphToMany { diff --git a/app/Models/ServerTransfer.php b/app/Models/ServerTransfer.php index 861252c66..b903cbbb8 100644 --- a/app/Models/ServerTransfer.php +++ b/app/Models/ServerTransfer.php @@ -70,6 +70,8 @@ class ServerTransfer extends Model /** * Gets the server associated with a server transfer. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Server, $this> */ public function server(): BelongsTo { @@ -78,6 +80,8 @@ class ServerTransfer extends Model /** * Gets the source node associated with a server transfer. + * + * @return \Illuminate\Database\Eloquent\Relations\HasOne<\Pterodactyl\Models\Node, $this> */ public function oldNode(): HasOne { @@ -86,6 +90,8 @@ class ServerTransfer extends Model /** * Gets the target node associated with a server transfer. + * + * @return \Illuminate\Database\Eloquent\Relations\HasOne<\Pterodactyl\Models\Node, $this> */ public function newNode(): HasOne { diff --git a/app/Models/ServerVariable.php b/app/Models/ServerVariable.php index 7acca466a..eecdd4552 100644 --- a/app/Models/ServerVariable.php +++ b/app/Models/ServerVariable.php @@ -41,6 +41,8 @@ class ServerVariable extends Model /** * Returns the server this variable is associated with. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Server, $this> */ public function server(): BelongsTo { @@ -49,6 +51,8 @@ class ServerVariable extends Model /** * Returns information about a given variables parent. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\EggVariable, $this> */ public function variable(): BelongsTo { diff --git a/app/Models/Subuser.php b/app/Models/Subuser.php index e8c74a49d..1d263b0dc 100644 --- a/app/Models/Subuser.php +++ b/app/Models/Subuser.php @@ -65,6 +65,8 @@ class Subuser extends Model /** * Gets the server associated with a subuser. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Server, $this> */ public function server(): BelongsTo { @@ -73,6 +75,8 @@ class Subuser extends Model /** * Gets the user associated with a subuser. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\User, $this> */ public function user(): BelongsTo { @@ -81,6 +85,8 @@ class Subuser extends Model /** * Gets the permissions associated with a subuser. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Permission, $this> */ public function permissions(): HasMany { diff --git a/app/Models/Task.php b/app/Models/Task.php index 15d699473..50dab16eb 100644 --- a/app/Models/Task.php +++ b/app/Models/Task.php @@ -111,6 +111,8 @@ class Task extends Model /** * Return the schedule that a task belongs to. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Schedule, $this> */ public function schedule(): BelongsTo { @@ -119,9 +121,11 @@ class Task extends Model /** * Return the server a task is assigned to, acts as a belongsToThrough. + * + * @return \Znck\Eloquent\Relations\BelongsToThrough<\Pterodactyl\Models\Server, \Pterodactyl\Models\Schedule> */ public function server(): \Znck\Eloquent\Relations\BelongsToThrough { - return $this->belongsToThrough(Server::class, Schedule::class); + return $this->belongsToThrough(Server::class, Schedule::class); // @phpstan-ignore return.type } } diff --git a/app/Models/User.php b/app/Models/User.php index 44dfdbf9b..f86878b8c 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -228,23 +228,34 @@ class User extends Model implements /** * Returns all servers that a user owns. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\Server, $this> */ public function servers(): HasMany { return $this->hasMany(Server::class, 'owner_id'); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\ApiKey, $this> + */ public function apiKeys(): HasMany { return $this->hasMany(ApiKey::class) ->where('key_type', ApiKey::TYPE_ACCOUNT); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\RecoveryToken, $this> + */ public function recoveryTokens(): HasMany { return $this->hasMany(RecoveryToken::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Pterodactyl\Models\UserSSHKey, $this> + */ public function sshKeys(): HasMany { return $this->hasMany(UserSSHKey::class); @@ -253,6 +264,8 @@ class User extends Model implements /** * Returns all the activity logs where this user is the subject — not to * be confused by activity logs where this user is the _actor_. + * + * @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\Pterodactyl\Models\ActivityLog, $this> */ public function activity(): MorphToMany { @@ -262,6 +275,8 @@ class User extends Model implements /** * Returns all the servers that a user can access by way of being the owner of the * server, or because they are assigned as a subuser for that server. + * + * @return \Illuminate\Database\Eloquent\Builder<\Pterodactyl\Models\Server> */ public function accessibleServers(): Builder { diff --git a/app/Models/UserSSHKey.php b/app/Models/UserSSHKey.php index 97b4725b8..3f0396a46 100644 --- a/app/Models/UserSSHKey.php +++ b/app/Models/UserSSHKey.php @@ -60,6 +60,9 @@ class UserSSHKey extends Model 'public_key' => ['required', 'string'], ]; + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\User, $this> + */ public function user(): BelongsTo { return $this->belongsTo(User::class);