Register and fire custom events.

edited May 3 in Core

Hello can any one explain me, how to create custom event and fire it in controller in atlantis , because in laravel it is differently handled. I have read the documentation and couldn't understand properly. Atlantis comes with pretty much events amazing atlantis !!!

Comments

  • Into modules/atlantis/site/src/Module/Site/Events/SiteEvent.php you will find subscribe method. You can register events like this
    $events->listen('demo_event', 'Module\Site\Events\SiteEvent@MyMethod');

    Then you can fire the event whereever you want by calling \Event::fire
    Example:

    $evntData = [
       'data' => $myData,
    ];
    \Event::fire('demo_event', [$evntData]);
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!