@php $toastTypes = [ 'success' => session('success'), 'error' => session('error') ?? session('danger'), 'warning' => session('warning'), 'info' => session('info') ?? session('status'), ]; // If there are validation errors, show a generic message or first error $validationError = null; if (isset($errors) && $errors->any()) { $validationError = $errors->first(); } @endphp
@foreach($toastTypes as $type => $message) @if($message) @endif @endforeach @if($validationError) @endif
@push('scripts') @endpush