{{-- Toast v2 — supports: success | error | info | warning types, positions (top|bottom)-(left|right|center), action buttons, swipe-to-dismiss, pause-on-hover. Backward compatible with existing `$this->dispatch('notify', [...])` calls. --}}
@foreach (['top-right','bottom-right','top-left','bottom-left','top-center','bottom-center'] as $pos) @php [$vy, $hx] = explode('-', $pos); $posClasses = [ 'top-right' => 'top-4 right-4 items-end', 'bottom-right' => 'bottom-4 right-4 items-end flex-col-reverse', 'top-left' => 'top-4 left-4 items-start', 'bottom-left' => 'bottom-4 left-4 items-start flex-col-reverse', 'top-center' => 'top-4 left-1/2 -translate-x-1/2 items-center', 'bottom-center'=> 'bottom-4 left-1/2 -translate-x-1/2 items-center flex-col-reverse', ][$pos]; $enterFromClass = match($hx) { 'left' => 'opacity-0 -translate-x-full scale-95', 'center' => 'opacity-0 scale-95 ' . ($vy === 'top' ? '-translate-y-4' : 'translate-y-4'), default => 'opacity-0 translate-x-full scale-95', }; $leaveToClass = $enterFromClass; @endphp
@endforeach