优化 代码格式

This commit is contained in:
iVampireSP.com 2022-11-21 11:53:13 +08:00
parent 86da37fe19
commit 682a8e7d02
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -127,14 +127,13 @@ public function update(Request $request, Host $host): JsonResponse
*/
public function destroy($host): JsonResponse
{
if ($host instanceof Host) {
$host->delete();
} else {
// if host not instance of Host
if (!$host instanceof Host) {
$host = Host::findOrFail($host);
}
$host?->delete();
}
return $this->deleted($host);
return $this->deleted();
}
}