diff --git a/app/Http/Controllers/YabsController.php b/app/Http/Controllers/YabsController.php index e81611e..75f9f8f 100644 --- a/app/Http/Controllers/YabsController.php +++ b/app/Http/Controllers/YabsController.php @@ -130,9 +130,18 @@ class YabsController extends Controller public function destroy(Yabs $yab) { $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') ->with('success', 'YABs was deleted Successfully.');