Files

45 lines
916 B
PHP
Raw Permalink Normal View History

2015-12-08 18:33:33 -05:00
<?php
2016-12-07 22:46:38 +00:00
2026-10-05 18:10:18 -04:00
declare(strict_types=1);
2015-12-08 18:33:33 -05:00
namespace Pterodactyl\Models;
2026-10-05 18:10:18 -04:00
use Illuminate\Database\Eloquent\Attributes\Guarded;
2022-10-14 10:59:20 -06:00
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
2026-10-11 22:55:07 -04:00
* @property-read EggVariable $variable
*/
2026-10-05 18:10:18 -04:00
#[Guarded(['id', 'created_at', 'updated_at'])]
class ServerVariable extends Model
2015-12-08 18:33:33 -05:00
{
2026-10-05 18:10:18 -04:00
public const string RESOURCE_NAME = 'server_variable';
2026-10-05 18:10:18 -04:00
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'server_id' => 'integer',
'variable_id' => 'integer',
];
}
2017-08-12 15:32:34 -05:00
/**
2026-10-05 18:10:18 -04:00
* @return BelongsTo<Server, $this>
2017-08-12 15:32:34 -05:00
*/
2022-10-14 10:59:20 -06:00
public function server(): BelongsTo
2017-08-12 15:32:34 -05:00
{
return $this->belongsTo(Server::class);
2017-08-12 15:32:34 -05:00
}
2017-08-12 15:32:34 -05:00
/**
2026-10-05 18:10:18 -04:00
* @return BelongsTo<EggVariable, $this>
2017-08-12 15:32:34 -05:00
*/
2022-10-14 10:59:20 -06:00
public function variable(): BelongsTo
2017-08-12 15:32:34 -05:00
{
2017-10-06 23:57:53 -05:00
return $this->belongsTo(EggVariable::class, 'variable_id');
2017-08-12 15:32:34 -05:00
}
2015-12-08 18:33:33 -05:00
}