在 Laravel 中使用Route::resource()控制器时包含 7 个方法。我不确定edit和update方法/资源之间有什么区别。
GET /resource/{resource}/edit edit resource.edit
PUT/PATCH /resource/{resource} update resource.update
Run Code Online (Sandbox Code Playgroud)
在我对 REST 的理解中,laravel 的update实现似乎是相当标准的,而edit在将资源作为 JSON 返回时,我无法想到使用它的场景。