fix: new service template layout

This commit is contained in:
Andras Bacsai
2023-09-25 17:41:35 +02:00
parent ee20c3339e
commit 0f8ccac775
6 changed files with 46 additions and 17 deletions

View File

@@ -3,7 +3,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Symfony\Component\Yaml\Yaml;
use Illuminate\Support\Facades\Cache;
class ServiceApplication extends BaseModel
{
@@ -16,7 +16,10 @@ class ServiceApplication extends BaseModel
}
public function documentation()
{
return data_get(Yaml::parse($this->service->docker_compose_raw), "services.{$this->name}.documentation", 'https://coolify.io/docs');
$services = Cache::get('services', []);
$service = data_get($services, $this->name, []);
ray($this->name);
return data_get($service, 'documentation', 'https://coolify.io/docs');
}
public function service()
{