Updated yabs delete

Updated yabs delete
This commit is contained in:
cp6 2022-03-05 11:57:12 +11:00
parent b3ed167ed9
commit b4f214f376

View File

@ -130,9 +130,18 @@ class YabsController extends Controller
public function destroy(Yabs $yab) public function destroy(Yabs $yab)
{ {
$id = $yab->id; $id = $yab->id;
$items = Yabs::find($id); $yabs = Yabs::find($id);
$yabs->delete();
$items->delete(); $disk = DiskSpeed::find($id);
$disk->delete();
$network = NetworkSpeed::find($id);
$network->delete();
$update_server = DB::table('servers')
->where('id', $yab->server_id)
->update(['has_yabs' => 0]);
return redirect()->route('yabs.index') return redirect()->route('yabs.index')
->with('success', 'YABs was deleted Successfully.'); ->with('success', 'YABs was deleted Successfully.');