@if ($message = Session::get('success'))
<script type="text/javascript">
  // toastr.success("{{ $message }}", 'Success.');  
  Swal.fire({
    icon: "success",
    title: "Success.",
    text: "{{ $message }}"
  });
</script>
@endif 
    
@if ($message = Session::get('error'))
<script type="text/javascript">
  Swal.fire({
    icon: "error",
    title: "Error!",
    text: "{{ $message }}"
  });
</script>
@endif
     
@if ($message = Session::get('warning'))
<script type="text/javascript">
  Swal.fire({
    icon: "warning",
    title: "Alert!",
    text: "{{ $message }}"
  }); 
</script>
@endif
     
@if ($message = Session::get('info'))
<script type="text/javascript">
  Swal.fire({
    icon: "info",
    title: "Info!",
    text: "{{ $message }}"
  });
</script>
@endif

@if ($message = Session::get('message'))
<script type="text/javascript">
  Swal.fire({
    icon: "info",
    title: "Info!",
    text: "{{ $message }}"
  });
</script>
@endif
    
@if ($errors->any())
@php $message = $errors->all(); 
$message = $message[0];
@endphp
<script type="text/javascript">
   toastr.options = {
    "closeButton": true,
    "debug": false,
    "newestOnTop": true,
    "progressBar": true,
    "positionClass": "toast-top-right",
    "preventDuplicates": false,
    "onclick": null,
    "showDuration": "300",
    "hideDuration": "1000",
    "timeOut": "5000",
    "extendedTimeOut": "1000",
    "showEasing": "swing",
    "hideEasing": "linear",
    "showMethod": "fadeIn",
    "hideMethod": "fadeOut"
  }

   toastr.error("{{ $message }}", 'Error!.');  
  // Swal.fire({
  //   icon: "error",
  //   title: "Error!",
  //   text: "{{ $message }}"
  // });
</script>

<!-- <script type="text/javascript">
  Swal.fire({
    icon: "error",
    title: 'Error!',
    text: "Please check the form below for errors"
  });
</script> -->
@endif