Relative Content

Tag Archive for laravelmodal-dialogpolymorphismlaravel-livewire

How to properly nest modal component?

I have a problem. I’m trying to create a modal window for reporting that dynamically serves both reporting comments and posts, so that it’s not necessary to create multiple modal windows. I’ve created a single component for reports that will serve both types of reports, but I’m struggling with ensuring that only one modal window opens for the given type, either for a post or for a comment. Currently, both modal windows open simultaneously – when I submit one, the other also opens. I can report both a post and a comment in the same view. However, I want the modal window to open only for the specific type. I’ve even tried creating two modal windows with different actions, but that didn’t help either. Regarding saving data to the database, that works fine. The issue is not related to that. I’m more concerned about the frontend process of how to open the modal window separately for each component based on what the user clicks, rather than both windows opening at once. Thank you for your assistance.