Permalink
Browse files

PostService() 新增 showAllPosts()

  • Loading branch information...
1 parent 33f673d commit 70964d9bf2013ebc4b092f0f7699d42f40b26568 Sam.IO.Hsiao committed Jul 27, 2016
Showing with 9 additions and 0 deletions.
  1. +9 −0 app/Services/PostService.php
@@ -29,4 +29,13 @@ public function showTitle(int $id, string $default) : string
{
return $this->postRepository->getTitle($id, $default);
}
+
+ public function showAllPosts()
+ {
+ $posts = $this->postRepository->getAllPosts();
+
+ foreach ($posts as $index => $post) {
+ echo($post->title);
+ }
+ }
}

0 comments on commit 70964d9

Please sign in to comment.