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 = '
';
foreach (session('errors') as $error) :
$errorMessage .= '- ' . $error . '
';
endforeach;
$errorMessage .= '
';
}
*/
?>
= $this->section('additionalInlineJs') ?>
function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){
var htmlString = `
`;
if(containerId == 'sk-alert'){
$(window).scrollTop(0);
}
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){
setTimeout(function(){
$('#' + containerId).fadeOut("slow");
}, 5000);
});
}
function popSuccessAlert(successMsg, containerId = 'sk-alert'){
popAlert(successMsg, "alert-success", "ti-check", containerId);
}
function popWarningAlert(warningMsg, containerId = 'sk-alert'){
popAlert(warningMsg, "alert-warning", "ti-bell", containerId);
}
function popErrorAlert(errorMsg, containerId = 'sk-alert'){
popAlert(errorMsg, "alert-danger", "ti-ban", containerId);
}
popSuccessAlert(`= $successMessage ?>`);
popWarningAlert(`= $warningMessage ?>`);
popErrorAlert(`= $errorMessage ?>`);
= $this->endSection() ?>