コード例 #1
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);
     }
 }
コード例 #2
0
ファイル: LatestPostsWidget.php プロジェクト: nmpribeiro/Blog
 /**
  * Get the widget data to send to the view
  * @return string
  */
 protected function data()
 {
     return ['posts' => $this->post->all()];
 }
コード例 #3
0
ファイル: PostController.php プロジェクト: optik/Blog
 /**
  * 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'));
 }
コード例 #4
0
ファイル: PostsWidget.php プロジェクト: optik/Blog
 /**
  * Get the widget data to send to the view
  * @return string
  */
 protected function data()
 {
     return ['postCount' => $this->post->all()->count()];
 }