DEV Community

Discussion on: Fluent interface and method chaining in PHP and JavaScript

Collapse
 
eugenevdm profile image
Eugene van der Merwe

This is a great and simple example, so easy to follow. I use Laravel a lot so knowing how to do it is important because Laravel relies heavily on chaining.

I'm struggling to see how one would use a constructor, say you have a lot of setup to always do. Any hints?