Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

286
Views
Mensaje de confirmación de cierre de sesión de Laravel 8, ¿cómo hacerlo?

Tengo un botón de cierre de sesión en mi navber.blade.php:

 <a class="dropdown-item" id="logout" href="{{ route('admin.logout') }}"> {{ __('Logout') }} </a>

Quiero que cuando haga clic en el botón de cierre de sesión, me muestre un mensaje de confirmación que me pregunte si desea cerrar sesión (sí o no). ¿Cómo hacer esto con jQuery o javascript?

Editar: he agregado este código jQuery

 <script> $(document).on("click", "#logout", function(e) { e.preventDefault(); var link = $(this).attr("href"); $.confirm({ title: 'Confirm!', content: 'Simple confirm!', buttons: { confirm: function () { $.alert('Confirmed!'); }, cancel: function () { $.alert('Canceled!'); }, somethingElse: { text: 'Something else', btnClass: 'btn-blue', keys: ['enter', 'shift'], action: function(){ $.alert('Something else?'); } } } }); }); </script>

Para cerrar sesión está mostrando un mensaje

ingrese la descripción de la imagen aquí

ingrese la descripción de la imagen aquí

Pero sin cerrar sesión.

Nota: soy solo un principiante de jQuery

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

me he perdido de agregar

 <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

Este enlace

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!