Permalink
Browse files

PostRepository 自動 use namespace

  • Loading branch information...
1 parent 6f415bc commit e9e14ebc547c7a805d78b4c880c6112172aaa31e Sam.IO.Hsiao committed Jul 28, 2016
Showing with 3 additions and 10 deletions.
  1. +3 −10 app/Repositories/PostRepository.php
@@ -5,19 +5,12 @@
namespace App\Repositories;
use App\Post;
+use Illuminate\Database\Eloquent\Collection;
class PostRepository
{
- /**
- * @param int $id
- * @param string $default
- * @return string
- */
- public function getTitle(int $id, string $default) : string
+ public function getAllPosts() : Collection
{
- return Post::whereId($id)
- ->get()
- ->first(null, new Post(['title' => $default]))
- ->title;
+ return Post::all();
}
}

0 comments on commit e9e14eb

Please sign in to comment.