Merge branch 'develop' into feature/server-mounts
This commit is contained in:
commit
29876e023b
166 changed files with 5482 additions and 4130 deletions
|
@ -2,6 +2,21 @@
|
|||
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $server_id
|
||||
* @property int $database_host_id
|
||||
* @property string $database
|
||||
* @property string $username
|
||||
* @property string $remote
|
||||
* @property string $password
|
||||
* @property int $max_connections
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
*
|
||||
* @property \Pterodactyl\Models\Server $server
|
||||
* @property \Pterodactyl\Models\DatabaseHost $host
|
||||
*/
|
||||
class Database extends Model
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,16 @@
|
|||
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $short
|
||||
* @property string $long
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
*
|
||||
* @property \Pterodactyl\Models\Node[] $nodes
|
||||
* @property \Pterodactyl\Models\Server[] $servers
|
||||
*/
|
||||
class Location extends Model
|
||||
{
|
||||
/**
|
||||
|
|
39
app/Models/RecoveryToken.php
Normal file
39
app/Models/RecoveryToken.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property string $token
|
||||
* @property \Carbon\CarbonImmutable $created_at
|
||||
*
|
||||
* @property \Pterodactyl\Models\User $user
|
||||
*/
|
||||
class RecoveryToken extends Model
|
||||
{
|
||||
/**
|
||||
* There are no updates to this model, only inserts and deletes.
|
||||
*/
|
||||
const UPDATED_AT = null;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $immutableDates = true;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
public static $validationRules = [
|
||||
'token' => 'required|string',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@ namespace Pterodactyl\Models;
|
|||
*
|
||||
* @property \Pterodactyl\Models\Server $server
|
||||
*/
|
||||
class ServerTransfer extends Validable
|
||||
class ServerTransfer extends Model
|
||||
{
|
||||
/**
|
||||
* The resource name for this model when it is transformed into an
|
||||
|
|
|
@ -90,7 +90,7 @@ class Task extends Model
|
|||
'schedule_id' => 'required|numeric|exists:schedules,id',
|
||||
'sequence_id' => 'required|numeric|min:1',
|
||||
'action' => 'required|string',
|
||||
'payload' => 'required|string',
|
||||
'payload' => 'required_unless:action,backup|string',
|
||||
'time_offset' => 'required|numeric|between:0,900',
|
||||
'is_queued' => 'boolean',
|
||||
];
|
||||
|
|
|
@ -39,6 +39,7 @@ use Pterodactyl\Notifications\SendPasswordReset as ResetPasswordNotification;
|
|||
* @property \Pterodactyl\Models\ApiKey[]|\Illuminate\Database\Eloquent\Collection $apiKeys
|
||||
* @property \Pterodactyl\Models\Server[]|\Illuminate\Database\Eloquent\Collection $servers
|
||||
* @property \Pterodactyl\Models\DaemonKey[]|\Illuminate\Database\Eloquent\Collection $keys
|
||||
* @property \Pterodactyl\Models\RecoveryToken[]|\Illuminate\Database\Eloquent\Collection $recoveryTokens
|
||||
*/
|
||||
class User extends Model implements
|
||||
AuthenticatableContract,
|
||||
|
@ -164,7 +165,7 @@ class User extends Model implements
|
|||
'name_last' => 'required|string|between:1,255',
|
||||
'password' => 'sometimes|nullable|string',
|
||||
'root_admin' => 'boolean',
|
||||
'language' => 'required|string',
|
||||
'language' => 'string',
|
||||
'use_totp' => 'boolean',
|
||||
'totp_secret' => 'nullable|string',
|
||||
];
|
||||
|
@ -251,4 +252,12 @@ class User extends Model implements
|
|||
return $this->hasMany(ApiKey::class)
|
||||
->where('key_type', ApiKey::TYPE_ACCOUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function recoveryTokens()
|
||||
{
|
||||
return $this->hasMany(RecoveryToken::class);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue