应该返回Laravel API创建和编辑方法的内容?

I had a question about the APIs. The methods that Laravel resource creates are create, edit, show, update, destroy, store. The methods update, show, destroy and store are understandable (object manipulation), but what should an API return in create and edit methods? html forms for creating and editing? and what if the API is JSON?

They are not needed for an API. You can disable them like this:

Route::resource("post", "PostsController", ["except" => ["create", "edit"]]);

It's better to have a JSON response, because it has more advantage over XML.

RESTful API's should be designed to be fast, reliable and easy to use. JSON is becoming the data exchange format of choice because it aligns so well with those goals. But, until standards shake out that allow developers to use more generalized clients to parse JSON data and provide strict type and format validation, XML will likely be the format of choice for API developers most concerned about providing a rigid data structure. We may well see the JSON standards shake out in the next year or two, which means XML may soon be consigned the same fate as floppy disks and punch cards.

Refer: Link

As far as the response is concerned, you can give response as

return response(['status' => true, 'message' => 'Entry Added / Update', 'data' => $data / []])

It depend upon the platform, for which you are building the API, if you don't want to share data on the screen, like you just want to notify user that there data is added or update or deleted, a simple message is more then enough. But if you want to show data (some) to the user then you can add updated data in an array as shown above.