コード例 #1
0
ファイル: PostController.php プロジェクト: optik/Blog
 /**
  * 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');
 }
コード例 #2
0
 /**
  *
  */
 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);
     }
 }