Don't use POST for filtering, use GET parameters.
Whats wrong with using post? I don't want to create a url with ids and or data in it.
Your Route::any is catching the POST to /objectives and sending any type of request (GET,POST,PUT,PATCH,DELETE) to the index method.
When using resourceful controllers (which you are by doing Route::resource) your /objectives/create route should be POSTing to /objectives. This is why you will have an issue using POST for filtering instead of get.
If you want to do restful controllers use Route::controller instead. Then you can use getIndex, postIndex, etc.
tpbsv77 said:
Whats wrong with using post? I don't want to create a url with ids and or data in it.
Don't you think filtering with GET gives you more control? You may use these URLs to make shortcuts in your app. Just a personal opinion.
My question was what is wrong with using Post? I have no problem using get but in some instances I don't need to pass all that data like that. So I was looking more for how do I solve the issue using POST as I was going in a circle.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community