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 Apr. 24th 2017

Let's Build A Forum with Laravel and TDD: Extracting Controller Queries to the Model

Episode 27 Run Time 7:39


At the moment, we have a long, fluent Eloquent query in our controller. Instead, let's use TDD to extract it into the Activity model.

View the source code for this episode on GitHub.