/** * Remove the specified resource from storage. * * @param Post $post * @return \Illuminate\Http\RedirectResponse */ public function destroy(Post $post) { $post->tags()->detach(); $this->post->destroy($post); flash(trans('blog::messages.post deleted')); return redirect()->route('admin.blog.post.index'); }
/** * */ private function emptyBlogTables() { foreach ($this->post->all() as $post) { $this->post->destroy($post); } foreach ($this->category->all() as $category) { $this->category->destroy($category); } foreach ($this->tag->all() as $tag) { $this->tag->destroy($tag); } }