duanlv1366 2015-10-08 19:55
浏览 245
已采纳

在Laravel 4.2中路由时无效的路由

I'm trying to create a new route, and for the life of me can't figure out why it's returning an invalid route response.

Here is the route (there are no filters on this route):

Route::get('api/books/{bookId}', 'BookController@getBook');

Here is the URL I use to query this route:

https://fakeBookSite.com/api/books/2?apiKey=someRandomKey

What is even stranger is that this route works:

Route::get('api/books', 'BookController@getBooks');

The route that works is listed BEFORE the one that doesn't, which is best practice in my understanding.

Even stranger, when I comment out the routes that do work, they still work when queried. I can only imagine that this is a caching issue, but as you will see below, I have cleared all the caches that I know about.

I have ran composer dump and composer clear and php artisan cache:clear. Your thoughts are highly appreciated!

  • 写回答

1条回答 默认 最新

  • dongyou2305 2015-10-09 18:14
    关注

    The issue was actually a result of my FTP connection. I suppose that the files I was editing were not actually changing the server files. This just goes to show that if you feel you've tried everything, just 'restarting' is the way to go!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大