has('message')) { $successMessage = session('message'); } if (session()->has('error')) { $errorMessage = is_array(session('error')) ? implode(session('error')) : session('error'); } /* // Uncomment this block if you want the errors listed line by line in the alert elseif (session()->has('errors')) { $errorMessage = ''; } */ ?>
section('globalJsFunctions') ?> function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert', fade = true){ var htmlString = ` `; if(containerId == 'sk-alert'){ $(window).scrollTop(0); } if(fade){ $('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){ setTimeout(function(){ $('#' + containerId).fadeOut("slow"); }, 5000); }); } else{ $('#' + containerId).hide().empty().html(htmlString).fadeIn("slow"); $('html, body').animate({ scrollTop: 0 }, 500); } } function popSuccessAlert(successMsg, containerId = 'sk-alert', fade = true){ popAlert(successMsg, "alert-success", "ti-check", containerId, fade); } function popWarningAlert(warningMsg, containerId = 'sk-alert', fade = true){ popAlert(warningMsg, "alert-warning", "ti-bell", containerId, fade); } function popErrorAlert(errorMsg, containerId = 'sk-alert', fade = true){ popAlert(errorMsg, "alert-danger", "ti-ban", containerId, fade); } function popAlert2Hide(containerId = 'sk-alert-2'){ $('#' + containerId).hide().empty().fadeIn("slow", function(){ setTimeout(function(){ $('#' + containerId).fadeOut("slow"); }, 2000); }); } popSuccessAlert(``); popWarningAlert(``); popErrorAlert(``); endSection() ?>