Buy your loved one the ultimate gift. Lifetime gift certificates are $100 off.

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 Oct. 3rd 2017

Let's Build A Forum with Laravel and TDD: Confusing Errors and Solutions

Episode 82 Run Time 11:08

Download

What happens if a "best reply" is deleted by its owner? Shouldn't we update the owning thread to nullify the best_reply_id column? Otherwise, that column will refer to a reply that doesn't exist. In this episode, we'll add a database constraint to perform this update automatically. However, as we implement it, we'll encounter a few confusing issues that aren't so easy to debug.

View the source code for this episode on GitHub.