Home > Mobile >  My post route doesn't work, postman thinks it is GET request
My post route doesn't work, postman thinks it is GET request

Time:12-05

I have my resource Route, it works fine for GET, but it doesn't work for post method

Route::resource('cart', CartController::class);

I have tried clearing the cache but it didn't solve.

a screenshot from postman:

GET request:

GET request

Post request:

Post request

CodePudding user response:

I have solved the problem, but I didn't actually know the real reason behind it.

Maybe it is because I remove the valet link and make another one, something related to the caching although I cleared all the cache before.

thank you all for your help

CodePudding user response:

Verb URI Action Route Name

GET /photos index photos.index

GET /photos/create create photos.create

POST /photos store photos.store

GET /photos/{photo} show photos.show

GET /photos/{photo}/edit edit photos.edit

PUT/PATCH /photos/{photo} update photos.update

DELETE /photos/{photo} destroy photos.destroy

make sure your url is in this format

  • Related