Back to the Learning

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.

Mentionable Usernames with TDD

Episode 33 Run Time 24:31

For the next version of the Laracasts forum, we offer a small feature that provides @username autocompletion when writing a new reply. To populate this list of usernames, we reference the conversation owner, every person who has left a reply, and all usernames who have been mentioned within those replies. Let me show you how to construct this very logic from scratch, using TDD. This lesson will give us a chance to flex our regex and refactoring muscles, so it should be fun! Let's get started.

Publish Date: September 21, 2018