@@ -713,14 +713,15 @@ public function update(RestifyRequest $request, $repositoryId)
713713
714714 public function patch (RestifyRequest $ request , $ repositoryId )
715715 {
716- DB ::transaction (function () use ($ request ) {
717- $ keys = $ request ->json ()->keys ();
716+ $ keys = $ request ->json ()->keys ();
718717
718+ DB ::transaction (function () use ($ request , $ keys ) {
719719 $ fields = $ this ->collectFields ($ request )
720720 ->filter (
721721 fn (Field $ field ) => in_array ($ field ->attribute , $ keys ),
722722 )
723723 ->forUpdate ($ request , $ this )
724+ ->withoutActions ($ request , $ this )
724725 ->authorizedPatch ($ request )
725726 ->merge ($ this ->collectFields ($ request )->forBelongsTo ($ request ));
726727
@@ -739,6 +740,16 @@ public function patch(RestifyRequest $request, $repositoryId)
739740 fn (Field $ field ) => $ field ->invokeAfter ($ request , $ this ->resource )
740741 );
741742
743+ $ this
744+ ->collectFields ($ request )
745+ ->filter (
746+ fn (Field $ field ) => in_array ($ field ->attribute , $ keys ),
747+ )
748+ ->forUpdate ($ request , $ this )
749+ ->withActions ($ request , $ this )
750+ ->authorizedPatch ($ request )
751+ ->each (fn (Field $ field ) => $ field ->actionHandler ->handle ($ request , $ this ->resource ));
752+
742753 return data ($ this ->serializeForShow ($ request ));
743754 }
744755
0 commit comments