lasthourcloud/app/Models/StandaloneDocker.php
Andras Bacsai 752c86d8f7 wip
2023-05-16 11:02:51 +02:00

29 lines
606 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 databases()
{
return $this->morphMany(Database::class, 'destination');
}
public function server()
{
return $this->belongsTo(Server::class);
}
public function attachedTo()
{
return $this->applications->count() > 0 || $this->databases->count() > 0;
}
}