1👍
Maybe a answer for:
Why resources doesn’t work ?
Route
This is maybe a typo in your edit and not in your code, but is not resources
:
Route::resources('/blog-comments', 'DashboardBlogCommentsController');
is resource
:
Route::resource('/blog-comments', 'DashboardBlogCommentsController');
And based on the code before the UPDATE of your question:
Controller DashboardBlogCommentsController
public function destroy(BlogComments $comment){
// use delete() on the variable where you assigned the object
$comment->delete();
return response()->json([
// 'comments'=> $id, this no needed, the comment doesn't exist anymore
'message' => 'OK!' ], 202);
}
Hope it’s helps
Source:stackexchange.com