fix DB server
This commit is contained in:
@@ -34,22 +34,20 @@ class ScheduledDatabaseBackup extends BaseModel
|
|||||||
{
|
{
|
||||||
return $this->hasMany(ScheduledDatabaseBackupExecution::class)->where('created_at', '>=', now()->subDays($days))->get();
|
return $this->hasMany(ScheduledDatabaseBackupExecution::class)->where('created_at', '>=', now()->subDays($days))->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function server()
|
public function server()
|
||||||
{
|
{
|
||||||
$database = $this->database;
|
if ($this->database) {
|
||||||
if (!$database) {
|
if ($this->database->destination && $this->database->destination->server) {
|
||||||
return null;
|
$server = $this->database->destination->server;
|
||||||
|
ray('Server found:', $server);
|
||||||
|
ray('Server details:', [
|
||||||
|
'id' => $server->id,
|
||||||
|
'name' => $server->name,
|
||||||
|
'ip' => $server->ip
|
||||||
|
]);
|
||||||
|
return $server;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (method_exists($database, 'server')) {
|
|
||||||
return $database->server;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (method_exists($database, 'service') && $database->service) {
|
|
||||||
return $database->service->server;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user