12.3 Events With Parameters
Extra information can be passed to a listener from a fired event by passing an array of values to
the event closure. Like this..
1 <?php
2
3 $responses = Event::fire('dinner.time', array(1, 2, 3));
We can then add parameters to the closure in our listener to ‘catch’ these values, like so :
1 <?php
2
3 Event::listen('dinner.time', function($one, $two, $three) {
4 return 'thanks for the grub!';
5 });
Easy as pie! Which coincidentally is what is for dinner.