I'm currently developing a 1-page CRUD application using Laravel, and I've encountered an issue. Whenever I delete a user that was just edited, I either get a blank page or a 404 error. It seems like this happens because the link it returns is: admin/user/{id}. I would like to modify it so that it returns the base URL: admin/user without the {id} at the end. Is there a way to achieve this?
Controller destroy code:
public function destroy($id)
{
$user = User::find($id);
$user->delete();
return back();
}