29.07.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contracts 135<br />

.<br />

22 public function __construct(Database $redis)<br />

23 {<br />

24 $this->redis = $redis;<br />

25 }<br />

26<br />

27 /**<br />

28 * Handle the event.<br />

29 *<br />

30 * @param NewUserRegistered $event<br />

31 * @return void<br />

32 */<br />

33 public function handle(NewUserRegistered $event)<br />

34 {<br />

35 //<br />

36 }<br />

37 }<br />

When the event listener is resolved, the service container will read the type-hints on the constructor<br />

of the class, and inject the appropriate value. To learn more about registering things in the service<br />

container, check out its documentation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!