@if(session()->has('notify'))
    @foreach(session('notify') as $msg)
        <script>
            "use strict";
            modalMessage('{{ $msg[1] }}');
        </script>
    @endforeach
@endif

@if ($errors->any())
    @php
        $collection = collect($errors->all());
        $errors = $collection->unique();
    @endphp

    <script>
        "use strict";
        @foreach ($errors as $error)
        
        modalMessage('{{ __($error) }}');
        @endforeach
    </script>

@endif
<script>
    "use strict";
    function notify(status,message) {
        modalMessage(message);
    }
</script>
