lasthourcloud/app/Models/StandaloneDocker.php
2023-08-07 18:46:40 +02:00

28 lines
609 B
PHP

<?php
namespace App\Models;
class StandaloneDocker extends BaseModel
{
protected $fillable = [
'name',
'network',
'server_id',
];
public function applications()
{
return $this->morphMany(Application::class, 'destination');
}
public function postgresqls()
{
return $this->morphMany(Postgresql::class, 'destination');
}
public function server()
{
return $this->belongsTo(Server::class);
}
public function attachedTo()
{
return $this->applications->count() > 0 || $this->databases->count() > 0;
}
}