Unlocking Badges Workshop
Together, in this series we'll add an "Unlockable Badge" feature to the Laracasts website. Perhaps when a user reaches a certain XP threshold, they unlock a badge. Or when they reach 500 "Best Answer" slots, they earn yet another badge. You get the idea.
Let's research and implement this feature using TDD from scratch.
Series episodes
Begin With an Example
9m 23sKickstart new features with confidence using TDD. Learn how to define behavior through examples and build your system step-by-step from the ground up!
Event Fakery
14m 6sLearn how to test event broadcasting in your app by faking events when users earn experience, ensuring achievements and badges trigger seamlessly.
Use TDD to Construct Migrations and Attributes
6m 1sBuild an Achievement model and database table using TDD. Learn how test-driven development streamlines migrations and attribute creation in Laravel!
A User Can Be Awarded Achievements
8m 24sLearn how to link users with achievements using a generic pivot table. Build dynamic relationships in your app to track and award user accomplishments easily!
What If We Didn't Use a Database?
11m 54sExplore alternative ways to manage achievement badges without a database. Experiment with logic placement in Laravel and decide what works best for your app!
Nah
4m 16sExplore the pros and cons of skipping the database for user achievements. See why reverting to a better Laravel solution improves reliability and performance!
Syncing User Achievements With Collections
21m 45sLearn how to sync user achievements in Laravel using collections. Build a clean system to register and update achievements based on earned experience points!
Two Ways to Organize a Project
8m 22sExplore two effective ways to organize achievement-related files in Laravel, including service providers, events, and listeners for cleaner, maintainable projects!
Sensible Defaults With TDD
8m 48sUse TDD to set smart default achievement names based on class names. Streamline your Laravel development with clean, reliable, and automated naming!
An Artisan Command to Generate New Achievements
7m 24sCreate new achievement classes faster with a custom Artisan command. Boost your Laravel workflow with handy scaffolding tools that save time and effort!
Achievement Types Should Live Together
2m 44sOrganize your Laravel app by grouping achievement type classes into a dedicated directory. Keep your code clean, clear, and easy to maintain!
Viewing Achievements: Part 1
4m 36sBuild a dynamic achievement view in Laravel by seeding badges and toggling CSS to show earned status. See user progress clearly and interactively in your app!
Viewing Achievements: Part 2
7m 40sLearn to build a dynamic view that shows which achievements a user has earned or missed. Enhance your Laravel app with clear, engaging achievement displays!
We Need A Seeder Console Command
9m 56sBuild an Artisan seeder command with TDD to sync user achievements on deployment. Ensure all users start with accurate achievement data effortlessly!
The Real Laracasts Achievement Badges
5m 34sJoin me as I build the real Laracasts achievement badges. See how to design and add badges that reward your progress with style and clarity!
More Sensible Achievement Defaults
6m 8sSimplify achievements by setting kebab-case icon defaults and converting descriptions to methods. Streamline your Laravel code with smart, practical improvements!
Achievement Caching
4m 44sFix the N+1 issue by caching achievements forever in Laravel. Learn smart caching strategies to boost performance and simplify future updates effortlessly!
Custom Achievement Collections
7m 18sLearn how to create custom Eloquent collections in Laravel by overriding the newCollection method. Enhance your queries with tailored collection classes easily!
Color Coding Achievements
7m 42sLearn how to color code achievements by skill level in Laravel. Visualize beginner, intermediate, and advanced with dynamic UI backgrounds for clear user feedback!
Custom Collection Sorting With Lookup Tables
10m 59sLearn to sort custom collections in Laravel using lookup tables. Master skill-level sorting and discover where to place sorting logic for clean code!
That's a Wrap
6m 29sWrap up your learning journey with practical techniques you can apply to any Laravel component or feature. Boost your skills and build with confidence!




