Sweet alert in Laravel
Sweet alert can be easily cpnfigured in laravel using some javascript code.
Sweet alert can be easily cpnfigured in laravel using some javascript code.
Suppose, one have to show sweet alert after the success or fail response, it can be done in using below code.
@if(session()->has('alert'))
$(function () {
swal({
title: "Sorry",
text: "{{ session()->get('alert') }}",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "OK",
cancelButtonText: "Contact Us",
closeOnConfirm: false,
customClass: "Custom_Cancel"
})
});
@endif
sweet alert js src="https://unpkg.com/sweetalert2@7.8.2/dist/sweetalert2.all.js"
jquery cdn src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"
0 Comment's
Add Comment
Register to Reply
Login
Register