Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Aahhh damn that's smart. Why didn't I think of that, let me try this out and I'll let you know! Commented Feb 18, 2017 at 9:18
  • Works! Thanks for you help. Made some minor changes: since you do $this->group = $attributes you're setting the group variable so it's not necessary to make it empty again (with $this->group = [];). Thanks again! Commented Feb 18, 2017 at 9:23
  • @MelvinKoopmans If you call the group method, later make a call just to add (without group), it will automatically be grouped if you don't clean it up. Commented Feb 18, 2017 at 9:24
  • Do you have any idea how I can remove the need to specify use ($manager) when calling the group method? Can I somehow inject an instance into the closure within the group method? Commented Feb 18, 2017 at 9:29