Add mount_server table, fix wrong field type on other many to many tables, add routes for mounting and unmounting mounts on a server, finish server admin mounts page

This commit is contained in:
Matthew Penner 2020-05-21 14:23:12 -06:00
parent a0900b8b94
commit 0eb29dac9c
8 changed files with 119 additions and 22 deletions
app/Models

View file

@ -12,8 +12,9 @@ namespace Pterodactyl\Models;
* @property bool $read_only
* @property bool $user_mountable
*
* @property \Illuminate\Database\Eloquent\Relations\BelongsToMany $eggs
* @property \Illuminate\Database\Eloquent\Relations\BelongsToMany $nodes
* @property \Pterodactyl\Models\Egg[]|\Illuminate\Database\Eloquent\Collection $eggs
* @property \Pterodactyl\Models\Node[]|\Illuminate\Database\Eloquent\Collection $nodes
* @property \Pterodactyl\Models\Server[]|\Illuminate\Database\Eloquent\Collection $servers
*/
class Mount extends Model
{
@ -94,4 +95,14 @@ class Mount extends Model
{
return $this->belongsToMany(Node::class);
}
/**
* Returns all servers that have this mount assigned.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function servers()
{
return $this->belongsToMany(Server::class);
}
}