File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -356,10 +356,14 @@ public static function resource(string $pattern, $controller)
356356 static ::match ('GET|HEAD ' , $ pattern , "$ controller@index " );
357357 static ::post ($ pattern , "$ controller@store " );
358358 static ::match ('GET|HEAD ' , "$ pattern/create " , "$ controller@create " );
359- static ::match ('POST| DELETE ' , "$ pattern/{id}/delete " , "$ controller@destroy " );
360- static ::match ('POST| PUT|PATCH ' , "$ pattern/{id}/edit " , "$ controller@update " );
359+ static ::match ('DELETE ' , "$ pattern/{id} " , "$ controller@destroy " );
360+ static ::match ('PUT|PATCH ' , "$ pattern/{id} " , "$ controller@update " );
361361 static ::match ('GET|HEAD ' , "$ pattern/{id}/edit " , "$ controller@edit " );
362362 static ::match ('GET|HEAD ' , "$ pattern/{id} " , "$ controller@show " );
363+
364+ // still keeping DELETE and PUT|PATCH so earlier versions of leaf apps don't break
365+ static ::match ('POST|DELETE ' , "$ pattern/{id}/delete " , "$ controller@destroy " );
366+ static ::match ('POST|PUT|PATCH ' , "$ pattern/{id}/edit " , "$ controller@update " );
363367 }
364368
365369 /**
You can’t perform that action at this time.
0 commit comments