v0.9.15c - Delete news when you delete its guide

This commit is contained in:
frederikpyt 2020-08-14 12:07:18 +02:00
parent dccc084dee
commit 7dfcc36d07
1 changed files with 4 additions and 0 deletions

View File

@ -166,8 +166,12 @@ class GuideController extends Controller
public function destroy($guide) public function destroy($guide)
{ {
$guide = Guide::find($guide); $guide = Guide::find($guide);
$news = News::query()->where("type_id", "=", "4")->where("arrangement_id", "=", $guide->id)->first();
$news->delete();
$guide->delete(); $guide->delete();
return redirect()->route("guides.index"); return redirect()->route("guides.index");
} }