2023-03-27 14:31:42 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
class StandaloneDocker extends BaseModel
|
|
|
|
{
|
2023-08-11 16:13:53 +02:00
|
|
|
protected $guarded = [];
|
2023-08-08 11:51:36 +02:00
|
|
|
|
2023-03-27 14:31:42 +02:00
|
|
|
public function applications()
|
|
|
|
{
|
|
|
|
return $this->morphMany(Application::class, 'destination');
|
|
|
|
}
|
2023-08-08 11:51:36 +02:00
|
|
|
|
2023-08-07 18:46:40 +02:00
|
|
|
public function postgresqls()
|
2023-05-16 11:02:51 +02:00
|
|
|
{
|
2023-08-07 22:14:21 +02:00
|
|
|
return $this->morphMany(StandalonePostgresql::class, 'destination');
|
2023-05-16 11:02:51 +02:00
|
|
|
}
|
2023-08-08 11:51:36 +02:00
|
|
|
|
2023-03-28 15:47:37 +02:00
|
|
|
public function server()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Server::class);
|
|
|
|
}
|
2023-08-08 11:51:36 +02:00
|
|
|
|
2023-09-21 17:48:31 +02:00
|
|
|
public function services()
|
2023-09-20 15:42:41 +02:00
|
|
|
{
|
2023-09-21 17:48:31 +02:00
|
|
|
return $this->morphMany(Service::class, 'destination');
|
2023-09-20 15:42:41 +02:00
|
|
|
}
|
|
|
|
|
2023-05-16 11:02:51 +02:00
|
|
|
public function attachedTo()
|
|
|
|
{
|
2023-09-08 16:19:45 +02:00
|
|
|
return $this->applications?->count() > 0 || $this->databases?->count() > 0;
|
2023-05-16 11:02:51 +02:00
|
|
|
}
|
2023-08-07 22:14:21 +02:00
|
|
|
}
|