Add service-specific configuration fields and save

them to the database
This commit is contained in:
Andras Bacsai committed 2023-11-13 11:09:21 +01:00
1 parent 95baec99dd
commit ce0f560c44
12 files changed
+292 -46

No files matched your search

+10
View File
@@ -22,6 +22,16 @@ class ServiceApplication extends BaseModel
{
return 'service';
}
public function serviceType()
{
$found = str(collect(SPECIFIC_SERVICES)->filter(function ($service) {
return str($this->image)->before(':')->value() === $service;
})->first());
if ($found->isNotEmpty()) {
return $found;
}
return null;
}
public function service()
{
return $this->belongsTo(Service::class);