Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: scheduled database server

Andras Bacsaifd15c7b49e14
diff --git a/app/Models/ScheduledDatabaseBackup.php b/app/Models/ScheduledDatabaseBackup.php
index ce5d3a87fb..3921e32e4f 100644
--- a/app/Models/ScheduledDatabaseBackup.php
+++ b/app/Models/ScheduledDatabaseBackup.php
@@ -39,13 +39,19 @@ class ScheduledDatabaseBackup extends BaseModel
public function server()
{
if ($this->database) {
- if ($this->database->destination && $this->database->destination->server) {
- $server = $this->database->destination->server;
-
+ if ($this->database instanceof ServiceDatabase) {
+ $destination = data_get($this->database->service, 'destination');
+ $server = data_get($destination, 'server');
+ } else {
+ $destination = data_get($this->database, 'destination');
+ $server = data_get($destination, 'server');
+ }
+ if ($server) {
return $server;
}
}
+
return null;
}
}