File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ public static function successfulHttpStatusCode($method, $model = null)
277277 // if we did a put request, we need to ensure that the model wasn't
278278 // changed in other ways than those specified by the request
279279 // Ref: http://jsonapi.org/format/#crud-updating-responses-200
280- if ($ method === 'PUT ' && $ model instanceof Model) {
280+ if (( $ method === 'PATCH ' || $ method === ' PUT ') && $ model instanceof Model) {
281281 // check if the model has been changed
282282 if ($ model ->isChanged ()) {
283283 // return our response as if there was a GET request
@@ -288,6 +288,7 @@ public static function successfulHttpStatusCode($method, $model = null)
288288 switch ($ method ) {
289289 case 'POST ' :
290290 return BaseResponse::HTTP_CREATED ;
291+ case 'PATCH ' :
291292 case 'PUT ' :
292293 case 'DELETE ' :
293294 return BaseResponse::HTTP_NO_CONTENT ;
@@ -296,7 +297,7 @@ public static function successfulHttpStatusCode($method, $model = null)
296297 }
297298
298299 // Code shouldn't reach this point, but if it does we assume that the
299- // client has made a bad request, e.g. PATCH
300+ // client has made a bad request.
300301 return BaseResponse::HTTP_BAD_REQUEST ;
301302 }
302303
You can’t perform that action at this time.
0 commit comments