Toggle Alpine Modals Using Events

Written by Laracasts / Original link on Mar. 3, 2021

If you need to toggle an Alpine modal from anywhere in your application, it might be useful to reach for an event-based approach. In this lesson, we'll add a $'modal-name') API for activating any registered modal. To allow for this, we'll dispatch an event on the window object, and then listen for it from our modal Blade component.


« Git Support is Coming to the Laravel Installer - GitHub Availability Report: February 2021 »