Home > Software engineering >  Laravel 7 Sweet alert Uncaught ReferenceError: Swal is not defined
Laravel 7 Sweet alert Uncaught ReferenceError: Swal is not defined

Time:09-17

Controller: controller

Master Layout: MasterLayout

Alert blade: vendor-alert-blade

My question is how to fix this error. console log error The method in my controller is also working the alert is working but the problem is the Swal. help me to fix this. I will provide all code examples if needed. thank you!

CodePudding user response:

Please add the below sweet alert js and css

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js"></script>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.min.css'>
  • Related