'integer', 'port' => 'integer', ]; protected $appends = [ 'real_protocol', ]; public function server(): BelongsTo { return $this->belongsTo(Server::class); } public function addToServer(): void { dispatch(new AddToServer($this))->onConnection('ssh'); } public function removeFromServer(): void { $this->status = FirewallRuleStatus::DELETING; $this->save(); dispatch(new RemoveFromServer($this))->onConnection('ssh'); } public function getRealProtocolAttribute(): string { return $this->protocol === 'udp' ? 'udp' : 'tcp'; } }