From ed202c115bc980be19a7262d43f05242929c69b2 Mon Sep 17 00:00:00 2001 From: Sens van Aert Date: Sat, 30 Dec 2023 14:38:15 +0100 Subject: [PATCH] Fixed error when deleting news --- code/webapp/app/Http/Controllers/NewsController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/webapp/app/Http/Controllers/NewsController.php b/code/webapp/app/Http/Controllers/NewsController.php index 188f2c49..08fa30ec 100644 --- a/code/webapp/app/Http/Controllers/NewsController.php +++ b/code/webapp/app/Http/Controllers/NewsController.php @@ -122,6 +122,8 @@ public function destroy($id) Gate::authorize("allowAdmin"); $new = Info::find($id); + $news_content = InfoContent::where('info_id', $id); + $news_content->delete(); $new->delete(); $msg = "New Info Content Deleted successful! ";