persistentStorages()->delete(); $service->fileStorages()->delete(); }); } public function type() { return 'service'; } public function databaseType() { $image = str($this->image)->before(':'); if ($image->value() === 'postgres') { $image = 'postgresql'; } return "standalone-$image"; } 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); } public function scheduledBackups() { return $this->morphMany(ScheduledDatabaseBackup::class, 'database'); } }