优化 代码格式
This commit is contained in:
parent
86da37fe19
commit
682a8e7d02
@ -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();
|
$host?->delete();
|
||||||
}
|
|
||||||
|
|
||||||
return $this->deleted($host);
|
return $this->deleted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user