Skip to content

Commit fd15c7b

Browse files
committed
fix: scheduled database server
1 parent 7872818 commit fd15c7b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

app/Models/ScheduledDatabaseBackup.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@ public function get_last_days_backup_status($days = 7)
3939
public function server()
4040
{
4141
if ($this->database) {
42-
if ($this->database->destination && $this->database->destination->server) {
43-
$server = $this->database->destination->server;
44-
42+
if ($this->database instanceof ServiceDatabase) {
43+
$destination = data_get($this->database->service, 'destination');
44+
$server = data_get($destination, 'server');
45+
} else {
46+
$destination = data_get($this->database, 'destination');
47+
$server = data_get($destination, 'server');
48+
}
49+
if ($server) {
4550
return $server;
4651
}
4752
}
4853

54+
4955
return null;
5056
}
5157
}

0 commit comments

Comments
 (0)