Event Listeners


You can add listeners to perform other actions within your project. For example when an entry is added or a comment is submitted you can send an email notification.

Entry added

\Event::listen('Newelement\Neutrino\Events\EntryAdded',
    function ($event) {
        // Do your stuff with the entry added data $event
    }
);

Entry updated

\Event::listen('Newelement\Neutrino\Events\EntryUpdated',
    function ($event) {
        // Do your stuff with the entry updated data $event
    }
);

Comment submitted

\Event::listen('Newelement\Neutrino\Events\CommentSubmitted',
    function ($event) {
        // Do your stuff with the comment data $event
    }
);

Form submitted

\Event::listen('Newelement\Neutrino\Events\FormSubmitted',
    function ($event) {
        // Do your stuff with the form data $event
    }
);

In order to get the form listeners to work you will need to post the form data to:

/neutrino-form // For general forms
/neutrino-comment // For comment forms