@props([ 'message' => null, 'bag' => null, ]) @php $msg = $message; if ($msg === null && $bag !== null) { $msg = $errors?->{$bag}?->first(); } if ($msg === null && isset($errors) && $errors->any()) { $msg = $errors->first(); } @endphp @if ($msg)