// Establecemos variables var url = "{{str_replace("http:", "https:", Request::root())}}"; var urlApi = "{{str_replace("https://", "https://api", str_replace("http:", "https:", Request::root()))}}"; // Función: Cerrae sesión function cerrarSesion(){ $.ajax({ type: "POST", url: "{{route('cerrar-sesion')}}", data: { _token: $('meta[name="csrf-token"]').attr('content') }, success: function(datos){ // Establecemos los datos datos = $.parseJSON(datos); window.location.href = "{{route('ingresar')}}"; } }) }