'integer', 'server_log_id' => 'integer', 'variables' => 'array', ]; public function script(): BelongsTo { return $this->belongsTo(Script::class); } public function getContent(): string { $content = $this->script->content; foreach ($this->variables as $variable => $value) { if (is_string($value) && ! empty($value)) { $content = str_replace('${'.$variable.'}', $value, $content); } } return $content; } public function serverLog(): BelongsTo { return $this->belongsTo(ServerLog::class); } }