
{{-- =============================== --}}
{{--          TOASTR CONFIG          --}}
{{-- =============================== --}}

<script>

    toastr.options = {
        closeButton: true,
        debug: false,

        newestOnTop: true,
        progressBar: true,

        positionClass: "{{ $locale === 'ar' ? 'toast-top-right' : 'toast-top-left' }}",

        preventDuplicates: true,
        preventOpenDuplicates: true,

        onclick: null,

        showDuration: 300,
        hideDuration: 300,

        timeOut: 5000,
        extendedTimeOut: 1500,

        showEasing: "swing",
        hideEasing: "linear",

        showMethod: "fadeIn",
        hideMethod: "fadeOut",

        escapeHtml: true
    };

</script>

{{-- =============================== --}}
{{--          TOASTR ALERTS          --}}
{{-- =============================== --}}

<script>

    {{-- ✅ Success --}}
    @if(session()->has('success'))
    toastr.success("{{ session('success') }}", "{{ __('Success') }}");
    @endif

    {{-- ❌ Error --}}
    @if(session()->has('error'))
    toastr.error("{{ session('error') }}", "{{ __('Error') }}");
    @endif

    {{-- ℹ️ Info --}}
    @if(session()->has('info'))
    toastr.info("{{ session('info') }}", "{{ __('Info') }}");
    @endif

    {{-- ⚠️ Warning --}}
    @if(session()->has('warning'))
    toastr.warning("{{ session('warning') }}", "{{ __('Warning') }}");
    @endif

    {{-- 🚫 Inactive --}}
    @if(session()->has('inactive'))
    toastr.error("{{ session('inactive') }}", "{{ __('Inactive') }}");
    @endif

    {{-- ❌ Validation Errors --}}
    @if($errors->any())
    @foreach($errors->all() as $error)
    toastr.error("{{ $error }}", "{{ __('Validation Error') }}");
    @endforeach
    @endif
</script>
