有错误
修改理由:
此投稿已在 5年前 合并。
内容修改:
| Old | New | Differences |
|---|---|---|
| 162 | 162 | |
| 163 | 163 | public function getByUser(User $user) |
| 164 | 164 | { |
| 165 | return Blog::where('user_id' | |
| 165 | return Blog::where('user_id',$user->id)->get(); | |
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | ``` | … | … |
| 263 | 263 | 留意用另一个 *repository* 替代 *BlogRepository* 是多么容易! |
| 264 | 264 | |
| 265 | 265 | 不要忘记添加 *RepositoryServiceProvider* 到 *config/app.php* 文件的 *providers* 列表中。完成了这些后我们需要清空缓存: |
| 266 | ``` | |
| 267 | 'providers' => [ | |
| 268 | //测试¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ | |
| 269 | \App\Providers\RepositoryServiceProvider::class | |
| 270 | ||
| 271 | ], | |
| 272 | ``` | |
| 273 | ||
| 266 | 274 | |
| 267 | 275 | ``` |
| 268 | 276 | php artisan config:clear |
关于 LearnKu