In essence, view models are simple classes that take some data, and transform it into something usable for the view. In this post I'll show you the basic principles of the pattern, we'll take a look at how they integrate in Laravel projects, and finally I'll show you how we use the pattern in one of Spatie's, our company, projects.
Uptime and SSL certificate monitoring doesn't have to be boring, confusing or expensive. Together with my buddy Mattias Geniar I'm currently building Oh Dear: a webapp to keep an eye on the health of your websites. Register here to try it out. (sponsored link)