lasthourcloud/app/Models/ServiceDatabase.php
Andras Bacsai a5e6975dac fix: ui
2023-10-04 10:34:44 +02:00

33 lines
709 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class ServiceDatabase extends BaseModel
{
use HasFactory;
protected $guarded = [];
public function type()
{
return 'service';
}
public function service()
{
return $this->belongsTo(Service::class);
}
public function persistentStorages()
{
return $this->morphMany(LocalPersistentVolume::class, 'resource');
}
public function fileStorages()
{
return $this->morphMany(LocalFileVolume::class, 'resource');
}
public function getFilesFromServer(bool $isInit = false)
{
getFilesystemVolumesFromServer($this, $isInit);
}
}