@php($viewErrors = $errors ?? null)

@if (Session::has('sucmessage'))
    <div class="alert alert-success">
        {{ Session::get('sucmessage') }}
    </div>
@endif

@if (Session::has('message'))
    <div class="alert alert-danger">
        {{ Session::get('message') }}
    </div>
@endif

@if ($viewErrors && $viewErrors->any())
    <div class="alert alert-danger">
        <strong>Please check the highlighted details.</strong>
        <ul class="mb-0 mt-2 pl-3">
            @foreach ($viewErrors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
