Restructuring a Laravel Controller using Services, Events, Jobs, Actions, and more
In this tutorial, learn some of the ways you can refactor a controller and utilize services, events, jobs, actions and more
In this tutorial, learn some of the ways you can refactor a controller and utilize services, events, jobs, actions and more
You’ve probably cached some model data in the controller before, but I am going to show you a model caching technique that’s a little more granular using Active Record models in Laravel. Using a unique cache key on the model, you can cache properties and associations on your models that are automatically updated (and the cache invalidated) when the model ( …