This commit is contained in:
Andras Bacsai
2023-04-24 13:25:02 +02:00
parent 9d6c93768d
commit 570461a45f
8 changed files with 358 additions and 157 deletions

View File

@@ -37,23 +37,23 @@ class Application extends BaseModel
return $this->morphMany(LocalPersistentVolume::class, 'resource');
}
public function portsMappings(): Attribute
public function portsMappingsArray(): Attribute
{
return Attribute::make(
get: fn (string|null $portsMappings) =>
is_null($portsMappings)
get: fn () =>
is_null($this->ports_mappings)
? []
: explode(',', $portsMappings)
: explode(',', $this->ports_mappings)
);
}
public function portsExposes(): Attribute
public function portsExposesArray(): Attribute
{
return Attribute::make(
get: fn (string|null $portsExposes) =>
is_null($portsExposes)
get: fn () =>
is_null($this->ports_exposes)
? []
: explode(',', $portsExposes)
: explode(',', $this->ports_exposes)
);
}