Replies: 3 comments 8 replies
-
Or, seperating the logic, register more controllers for the same route. That way you can also have multiple providers using the same endpoint. It would help in such situation to specify the source. Or a filter telling laravel which controller logic to use. In your case it seems a whole lot of logic that does basically the same thing as invalid input response, but I may be missing something? |
Beta Was this translation helpful? Give feedback.
-
Hello. Usually all APIs have this situation and you check first if the response is valid and only then you validate it if needed. This happens for the JS clients that can't handle properly non 200 responses only. For api to api the second case with error should not happen on 200. |
Beta Was this translation helpful? Give feedback.
-
So I did a little research on what happens when a form request is passed into a controller method. And let me tell you two things: It's a whole lot and it's almost impossible to tap into that the way I suggested:
So, essentially, because of 4 and 6 resp. 8, chances of getting it implemented as proposed by me are slim at best. |
Beta Was this translation helpful? Give feedback.
-
Imagine, you have a webhook and you don't know if the request payload is
or
Currently, you'd create one request like this:
But what if you could do just this:
Beta Was this translation helpful? Give feedback.
All reactions