Add base support for creating a new API key for an account

This commit is contained in:
Dane Everitt 2020-03-22 18:15:38 -07:00
parent 32f25170f1
commit 933a4733e8
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
17 changed files with 371 additions and 13 deletions

View file

@ -36,6 +36,7 @@ use Pterodactyl\Notifications\SendPasswordReset as ResetPasswordNotification;
* @property \Carbon\Carbon $updated_at
*
* @property string $name
* @property \Pterodactyl\Models\ApiKey[]|\Illuminate\Database\Eloquent\Collection $apiKeys
* @property \Pterodactyl\Models\Permission[]|\Illuminate\Database\Eloquent\Collection $permissions
* @property \Pterodactyl\Models\Server[]|\Illuminate\Database\Eloquent\Collection $servers
* @property \Pterodactyl\Models\Subuser[]|\Illuminate\Database\Eloquent\Collection $subuserOf
@ -258,4 +259,13 @@ class User extends Validable implements
{
return $this->hasMany(DaemonKey::class);
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function apiKeys()
{
return $this->hasMany(ApiKey::class)
->where('key_type', ApiKey::TYPE_ACCOUNT);
}
}