Laravel 5: Events – Firing Events

Scheduler: Events – Firing Events


Firing Events – usage.

This is where you actually initiate all eventing process.

You invoke event process with proper even describing data, so Laravel knows, which event is being fired.

As in above code, you can pass event as an object:

Or you can use class name and pass it as a string, like this:

If you want, you can pass it the old way, like this:

 


Helper function event() refers to method fire():

(via interface for decoupling).