简体   繁体   中英

Invalid Route when routing in 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!

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM