feat: implement server tag management with individual fields and update routes
This commit is contained in:
@@ -31,26 +31,6 @@ class Server extends Model
|
||||
'tag3color',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get tags as an array of objects
|
||||
*/
|
||||
public function getTagsAttribute(): array
|
||||
{
|
||||
$tags = [];
|
||||
|
||||
if (!empty($this->tag1)) {
|
||||
$tags[] = ['text' => $this->tag1, 'color' => $this->tag1color ?? '#3498db'];
|
||||
}
|
||||
if (!empty($this->tag2)) {
|
||||
$tags[] = ['text' => $this->tag2, 'color' => $this->tag2color ?? '#3498db'];
|
||||
}
|
||||
if (!empty($this->tag3)) {
|
||||
$tags[] = ['text' => $this->tag3, 'color' => $this->tag3color ?? '#3498db'];
|
||||
}
|
||||
|
||||
return $tags;
|
||||
}
|
||||
|
||||
public function node()
|
||||
{
|
||||
return $this->belongsTo(Node::class);
|
||||
|
||||
Reference in New Issue
Block a user