-
|
I would like to configure a different response code for a POST operation. I couldn't find anything in the documentation about this related to Laravel in the State Processors section, since apparently, the integration with Controllers is only available for Symfony |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
If you're using a custom state processor in Laravel, simply return a Symfony\Component\HttpFoundation\Response or a Laravel Illuminate\Http\Response instance manually with the desired status code. If you return a raw Response, API Platform will not try to serialize again. Here is example code that might help you |
Beta Was this translation helpful? Give feedback.
-
|
I actually found the status property, which does exactly what I wanted. new Post(
...
status: 200,
) |
Beta Was this translation helpful? Give feedback.
I actually found the status property, which does exactly what I wanted.