Back to the Learning!

Laracasts is packed full with over 1,000 lessons just like this one.

Sign up to get full access or log in to your account and sit back.

Published On Aug. 22nd 2017

Let's Build A Forum with Laravel and TDD: Thread Views: Design #2 - Extract Class

Episode 69 Run Time 8:23

Download

In the previous episode, we successfully recorded the views count through a single trait, or concern. However, you may notice that the "visits" suffix is referenced in a number of method names. When you encounter repeated keywords, often it's an indication that a class is requesting to be extracted. Let's tackle that very thing in this episode, and then review the before and after.