At the time of executing the next destroy function, I get an error regarding the function with de laravel, they could help me.
function destroy($id,$route='none' ){
$destroy = User::find($id);
$destroy->delete();
if($route == 'equal'){
return back()->with('info','Usuario eliminado');
}else{
return route('home')->with('info','Usuario eliminado');
}
}