In this lesson, we'll review how to take a hardcoded Redis reference in our controllers, and extract its logic to a first class citizen. Beyond improved readability, an immediate benefit to this refactor is that it allows us to construct custom fakes for our tests. If we'd prefer that a particular test not hit Redis, we can now do so quite easily.
Published on Aug 18th, 2017.
Understand.io is used by hundreds of Laravel developers to find and fix errors.
Sign up for a free 14-day trial now.