/**
  *
  */
 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);
     }
 }
Exemplo n.º 2
0
 /**
  * Get the widget data to send to the view
  * @return string
  */
 protected function data()
 {
     return ['posts' => $this->post->all()];
 }
Exemplo n.º 3
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $posts = $this->post->all();
     return view('blog::admin.posts.index', compact('posts'));
 }
Exemplo n.º 4
0
 /**
  * Get the widget data to send to the view
  * @return string
  */
 protected function data()
 {
     return ['postCount' => $this->post->all()->count()];
 }