user->id) { abort(401); } $postid = $comment->post->id; $comment->delete(); return redirect("/posts/$postid"); } public function deletePost(Post $post) { $post->featured = null; $post->save(); $post->delete(); return redirect()->route('posts.home'); } public function deleteTag(Tag $tag) { $tag->delete(); return redirect()->route('tags.home'); } public function deleteTagGroup(TagGroup $tagGroup) { foreach ($tagGroup->tags as $tag) { $tag->delete(); } $tagGroup->delete(); return redirect()->route('tags.groups'); } }