v0.9.15c - Delete news when you delete its guide
This commit is contained in:
parent
dccc084dee
commit
7dfcc36d07
|
@ -166,8 +166,12 @@ class GuideController extends Controller
|
|||
public function destroy($guide)
|
||||
{
|
||||
$guide = Guide::find($guide);
|
||||
$news = News::query()->where("type_id", "=", "4")->where("arrangement_id", "=", $guide->id)->first();
|
||||
|
||||
$news->delete();
|
||||
$guide->delete();
|
||||
|
||||
|
||||
return redirect()->route("guides.index");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue