postman 调试话题列表报错
按照教程修改app/Http/Controllers/Api/TopicsController.php,增加index()后,用postman调试报错:
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The GET method is not supported for this route. Supported methods: POST. in file /home/vagrant/Code/larabbs/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php on line 256
更正:在routes\api.php中增加index路径
// 发布话题
Route::resource(‘topics’, ‘TopicsController’)->only([
‘store’, ‘update’, ‘destroy’,’index’]);
推荐文章: