2023-03-27 12:31:42 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
class StandaloneDocker extends BaseModel
|
|
|
|
{
|
2023-05-02 10:47:52 +00:00
|
|
|
protected $fillable = [
|
|
|
|
'name',
|
|
|
|
'network',
|
|
|
|
'server_id',
|
|
|
|
];
|
2023-03-27 12:31:42 +00:00
|
|
|
public function applications()
|
|
|
|
{
|
|
|
|
return $this->morphMany(Application::class, 'destination');
|
|
|
|
}
|
2023-08-07 16:46:40 +00:00
|
|
|
public function postgresqls()
|
2023-05-16 09:02:51 +00:00
|
|
|
{
|
2023-08-07 16:46:40 +00:00
|
|
|
return $this->morphMany(Postgresql::class, 'destination');
|
2023-05-16 09:02:51 +00:00
|
|
|
}
|
2023-03-28 13:47:37 +00:00
|
|
|
public function server()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Server::class);
|
|
|
|
}
|
2023-05-16 09:02:51 +00:00
|
|
|
public function attachedTo()
|
|
|
|
{
|
|
|
|
return $this->applications->count() > 0 || $this->databases->count() > 0;
|
|
|
|
}
|
2023-08-07 16:46:40 +00:00
|
|
|
}
|