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 May. 17th 2016

Whip Monstrous Code Into Shape: Consider View Models

Episode 11 Run Time 11:05


When you find yourself repeating the same view logic over and over, it might be time to extract that code into a reusable method. At first, developers typically reach for the model. However, you may quickly decide that you'd prefer a more dedicated class for this sorts of logic. In such cases, consider creating view presenters - or as some refer to them: view models.

View the source code for this lesson on GitHub.