mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-01 03:45:53 -05:00
42 lines
954 B
PHP
42 lines
954 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pterodactyl\Models;
|
|
|
|
use Database\Factories\LocationFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Guarded;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
|
|
|
#[Guarded(['id', 'created_at', 'updated_at'])]
|
|
class Location extends Model
|
|
{
|
|
/** @use HasFactory<LocationFactory> */
|
|
use HasFactory;
|
|
|
|
public const string RESOURCE_NAME = 'location';
|
|
|
|
public function getRouteKeyName(): string
|
|
{
|
|
return $this->getKeyName();
|
|
}
|
|
|
|
/**
|
|
* @return HasMany<Node, $this>
|
|
*/
|
|
public function nodes(): HasMany
|
|
{
|
|
return $this->hasMany(Node::class);
|
|
}
|
|
|
|
/**
|
|
* @return HasManyThrough<Server, Node, $this>
|
|
*/
|
|
public function servers(): HasManyThrough
|
|
{
|
|
return $this->hasManyThrough(Server::class, Node::class);
|
|
}
|
|
}
|