Route::resource('admin/category', 'Admin\CategoryController');
Defines the above route, now I want to delete the data, how to enter the Destroy method
Reply content:
Route::resource('admin/category', 'Admin\CategoryController');
Defines the above route, now I want to delete the data, how to enter the Destroy method
By changing the HTTP method of your request,
GET is the request data
POST is adding data
PUT is the update data
Delete is deleting data
The default is get for browser access, and form submission is usually post. To test your removal API, consider using some of the rest API's test tools, which have similar plugins in various browsers.
Behavior handled by the resource controller
Verb path Behavior route name
Get/photo Index Photo.index
Get/photo/create Creating Photo.create
Post/photo Save Photo.store
Get/photo/{photo} display Photo.show
Get/photo/{photo}/edit Edit Photo.edit
Put/patch/photo/{photo} update Photo.update
Delete/photo/{photo} Delete Photo.destroy
Also add a hidden field in the form, name= "_method"