/** * */ 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); } }
/** * Get the widget data to send to the view * @return string */ protected function data() { return ['posts' => $this->post->all()]; }
/** * 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')); }
/** * Get the widget data to send to the view * @return string */ protected function data() { return ['postCount' => $this->post->all()->count()]; }