修复 删除问题
This commit is contained in:
parent
1730f8a474
commit
4b16ca7ae4
@ -6,6 +6,7 @@
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class HostController extends Controller
|
||||
{
|
||||
@ -117,13 +118,18 @@ public function update(Request $request, Host $host)
|
||||
*/
|
||||
public function destroy($host)
|
||||
{
|
||||
|
||||
$host = Host::where('id', $host)->first($host);
|
||||
|
||||
if ($host) {
|
||||
if ($host instanceof Host) {
|
||||
$host->delete();
|
||||
} else {
|
||||
$host = Host::where('id', $host)->first($host);
|
||||
|
||||
if ($host) {
|
||||
$host->delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $this->deleted($host);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user