In this introduction episode, we'll kick things off by talking about how to add a “like” feature to your Laravel app—and why it's a good idea to use Redis instead of your database for this. If you’ve ever run into performance issues as your comment section grows, you’ll understand why reading which items a user has liked can get sluggish! So, we’re bypassing the DB for speeds' sake.
I’ll walk through a super simple (and admittedly boring!) interface to demo how liking and unliking comments works—instantly, thanks to Redis. You’ll see that nothing in the regular database tells us what’s been liked; it’s all handled elsewhere. We’ll also cover how to show users what they’ve liked (think: colored icons), and the process is fast and smooth.
By the end of the course, not only will we have this working on comments, but we’ll refactor it into a reusable trait. That means you can easily plug it into anything else—like articles or courses—in your app. It’s super flexible.
So, let’s get ready to set everything up and dive into building out this Laravel like system together!