HTTP status codes indicate the result of a request: 2xx success (200 OK, 201 Created, 204 No Content), 3xx redirection, 4xx client error (400, 401, 403, 404, 422), 5xx server error. An API must return the code that matches the situation.
Example
return response()->json($produit, 201);