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