修复 无法删除的 bug

This commit is contained in:
iVampireSP.com 2022-11-08 17:28:32 +08:00
parent 852dbcb50e
commit ac0b0da416
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -131,15 +131,13 @@ public function destroy($host)
if ($host instanceof Host) { if ($host instanceof Host) {
$host->delete(); $host->delete();
} else { } else {
$host = Host::where('id', $host)->first($host); $host = Host::findOrFail($host);
if ($host) { if ($host) {
$host->delete(); $host->delete();
} }
} }
return $this->deleted($host); return $this->deleted($host);
} }
} }