58522b59b7
- feat: service fixes - ui: help menu
38 lines
893 B
PHP
38 lines
893 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Symfony\Component\Yaml\Yaml;
|
|
|
|
class ServiceApplication extends BaseModel
|
|
{
|
|
use HasFactory;
|
|
protected $guarded = [];
|
|
|
|
public function type()
|
|
{
|
|
return 'service';
|
|
}
|
|
public function documentation()
|
|
{
|
|
return data_get(Yaml::parse($this->service->docker_compose_raw), "services.{$this->name}.documentation", 'https://coolify.io/docs');
|
|
}
|
|
public function service()
|
|
{
|
|
return $this->belongsTo(Service::class);
|
|
}
|
|
public function persistentStorages()
|
|
{
|
|
return $this->morphMany(LocalPersistentVolume::class, 'resource');
|
|
}
|
|
public function fileStorages()
|
|
{
|
|
return $this->morphMany(LocalFileVolume::class, 'resource');
|
|
}
|
|
public function saveFileVolumes()
|
|
{
|
|
saveFileVolumesHelper($this);
|
|
}
|
|
}
|