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"]]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With