Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Johny22's avatar

close popup if is session

Hi, how could I close the popup if it's in a close session?

<div id="modal" x-data="{
        show:@entangle($attributes->wire('model')).defer
    }" x-show="show"
    
    @if (session('close'))
    x-init="show = false"
    @endif

    x-on:keydown.escape.window="show = false"
    class="fixed inset-0 overflow-y-auto px-4 py-6 md:py-24 sm:px-0 z-40 inset-center">

    <div x-show="show" class="fixed inset-0 transform" x-on:click="show = false">
        <div class="absolute inset-0 bg-gray-500 opacity-75"></div>
    </div>
    <div x-show="show" class="rounded-lg ovrflow-hidden transform sm:w-full sm:mx-auto max-w-3xl h-5/6">
        {{ $slot }}
    </div>
</div>

0 likes
0 replies

Please or to participate in this conversation.