优化 代码格式

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 public function destroy($host): JsonResponse
{ {
if ($host instanceof Host) { // if host not instance of Host
$host->delete(); if (!$host instanceof Host) {
} else {
$host = Host::findOrFail($host); $host = Host::findOrFail($host);
$host?->delete();
} }
return $this->deleted($host); $host?->delete();
return $this->deleted();
} }
} }