'integer', 'site_id' => 'integer', 'auto_start' => 'boolean', 'auto_restart' => 'boolean', 'numprocs' => 'integer', 'redirect_stderr' => 'boolean', ]; public function getServerIdAttribute(int $value): int { if (! $value) { $value = $this->site->server_id; $this->fill(['server_id' => $this->site->server_id]); $this->save(); } return $value; } public function server(): BelongsTo { return $this->belongsTo(Server::class); } public function site(): BelongsTo { return $this->belongsTo(Site::class); } public function getLogDirectory(): string { return '/home/'.$this->user.'/.logs/workers'; } public function getLogFile(): string { return $this->getLogDirectory().'/'.$this->id.'.log'; } }