Path: blob/1.0-develop/app/Models/ServerVariable.php
10277 views
<?php12namespace Pterodactyl\Models;34use Illuminate\Database\Eloquent\Relations\BelongsTo;56/**7* @property int $id8* @property int $server_id9* @property int $variable_id10* @property string $variable_value11* @property \Carbon\CarbonImmutable|null $created_at12* @property \Carbon\CarbonImmutable|null $updated_at13* @property EggVariable $variable14* @property Server $server15*/16class ServerVariable extends Model17{18/**19* The resource name for this model when it is transformed into an20* API representation using fractal.21*/22public const RESOURCE_NAME = 'server_variable';2324protected bool $immutableDates = true;2526protected $table = 'server_variables';2728protected $guarded = ['id', 'created_at', 'updated_at'];2930protected $casts = [31'server_id' => 'integer',32'variable_id' => 'integer',33];3435public static array $validationRules = [36'server_id' => 'required|int',37'variable_id' => 'required|int',38'variable_value' => 'string',39];4041/**42* Returns the server this variable is associated with.43*44* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\Server, $this>45*/46public function server(): BelongsTo47{48return $this->belongsTo(Server::class);49}5051/**52* Returns information about a given variables parent.53*54* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Pterodactyl\Models\EggVariable, $this>55*/56public function variable(): BelongsTo57{58return $this->belongsTo(EggVariable::class, 'variable_id');59}60}616263