Build a Forum With Laravel
Building a forum is a great playground for getting acquainted with Laravel; there are so many little things to think about that really stretch the framework… and our minds! It's been a while since we built one on Laracasts, so join me as we create a feature rich forum together using the powerful ecosystem Laravel provides. Let's go!
Series episodes
Stack, Setup and Structure (5)
Selecting a Stack
5m 20sKickstart your Laravel project by choosing the right tools. Learn how to set up a new app with the Laravel installer and explore your best stack options.
Configuring Jetstream
11m 46sCustomize Jetstream to fit your app’s needs and understand how it works with Fortify. Unlock powerful, tailored authentication for your Laravel projects.
Defining Our Data
10m 20sScaffold users, posts, and comments with Eloquent in Laravel. Build a solid forum data structure quickly and confidently using Jetstream and Laravel.
Factories and Seeding
13m 5sQuickly seed your database with Laravel model factories. Learn to create dummy data fast and boost development with easy, efficient database seeding.
Test Suite Tinkering
7m 44sEnsure your Laravel test suite runs smoothly before building. Leverage Jetstream’s pre-built tests to create a seamless, efficient testing workflow.
Post Fundamentals (6)
Pest Driving Posts
16m 8sBuild robust post indexes with TDD in Laravel. Learn to write tests first and adapt layouts for both guests and authenticated users seamlessly.
From Model to Json
15m 5sProtect your data by mastering Laravel API resources. Learn how to safely convert Eloquent models to JSON without exposing private info.
Pagination and Performance
18m 33sOptimize your Post index with easy Laravel pagination and a custom Vue component. Fix performance bottlenecks for a faster, smoother app experience.
Helpful Test Helpers
19m 8sBoost your Laravel tests with helpful helpers to easily validate frontend data. Learn how refactoring improves code maintainability and speeds up development.
Showing a Single Post
13m 32sBuild a Post show route using test helpers, add date formatting with a frontend library, and streamline your Laravel workflow with handy reusable tools.
Linking Up the Index
6m 27sConnect your Post index to the show page using Inertia, optimize with eager loading, and enhance UI with Tailwind’s group hover for a smooth Laravel experience.
The CRUD of Comments (12)
Showing Comments on a Post
17m 27sEasily add paginated comments to your Post show page by reusing and creating components, while enhancing UX with relative dates for a polished forum experience.
The Only Inertia Trick You Need to Know
6m 59sDiscover a simple Inertia trick to optimize pagination by loading only needed comment data, boosting your app’s speed and efficiency with minimal effort.
Posting a Comment
18m 38sLearn how to build and test a Laravel comment form, mastering form handling while ensuring your forum’s core feature works flawlessly and efficiently.
The Comment Form
13m 9sBuild a comment form UI for your Post show page using Test Driven Development, adding seamless interaction after setting up a solid backend foundation.
Auth Issues
5m 15sEnsure your comment store route is protected with proper auth. Learn how to test and prevent guests from adding comments to keep your app secure and reliable. (157 characters) Let me know if you'd like it adjusted!
The "D" in "CRUD"
11m 26sBuild a simple, effective delete feature for comments and explore key considerations to handle removals confidently in your Laravel app’s CRUD operations. (157 characters) Let me know if you'd like it refined!
Say Hello to Policies
10m 57sUnify backend and frontend authorization with Laravel Policies. Easily wrap your authorization logic for quick, consistent model action checks anywhere in your app. (157 characters) Let me know if you'd like it refined!
Preventing the Pagination Problem
11m 3sFix the pagination reset bug when deleting comments and learn how to style your delete button for a smoother, more polished user experience in Laravel. (157 characters) Let me know if you'd like it adjusted!
Editing Comments: The Backend Edition
15m 52sBuild a test-driven backend for editing comments: write passing tests, then refactor controllers, policies, and routes for clean, maintainable code.
Editing Comments: The Frontend Edition
11m 24sBuild a Vue-powered frontend to edit comments by reusing your add-comment form—straightforward, practical step-by-step guidance.
Useful User Feedback: Toasts
11m 42sProvide clear user feedback with toasts! Learn how Jetstream’s built-in toast notifications enhance UX by confirming actions quickly and smoothly. (156 characters)
Useful User Feedback: Confirming Actions
22m 14sPrevent accidental deletions by adding seamless confirmation prompts. Enhance user experience and keep your app safe with simple, effective action confirmations. (157 characters)
Creating New Posts (5)
Creating Posts: the Backend Edition
16m 57sLearn how to build backend logic to store posts in your database, completing your app’s core functionality with clean, efficient code. (147 characters)
Creating Posts: the Frontend Edition
6m 52sBuild a simple frontend form to create new posts using the posts.store endpoint. Watch your work come alive as you connect backend and UI seamlessly. (157 characters)
Post Policies, Shared Data and Attributes
13mEnhance your Post creation by managing link visibility with policies and shared data, ensuring the right users see the right content effortlessly. (156 characters)
Using Slugs for SEO
15m 51sLearn to convert forum post titles into SEO-friendly slugs that boost discoverability, improve search rankings, and make URLs human-readable.
Fixing a Broken Test Suite
8m 44sFix your broken test suite step-by-step, patch failing tests, and add coverage for new features to keep your code reliable and robust. (153 characters)
Building a WYSIWYG Editor (6)
I: A New Editor
16m 7sTransform boring forum posts with TipTap, a powerful editor that lets users format text using Markdown—add titles, lists, emphasis, and more with ease! (157 characters)
II: Rise of the Toolbar
23m 46sAdd a user-friendly formatting toolbar to your forum using TipTap—perfect for users new to Markdown. Make text editing simple and intuitive! (153 characters)
III: The AI Wars
10m 12sEnhance your DatabaseSeeder by using ChatGPT to generate realistic posts, bridging the gap between real and seeded content effortlessly. (153 characters)
IV: Return of the HTML
13m 50sLearn how to convert Markdown into HTML for frontend display, exploring the best methods to deliver clean, user-friendly content in your Laravel app.
V: The Comment Strikes Back
13m 50sExtend markdown support to comments by creating a reusable trait and updating the MarkdownEditor component for seamless post and comment editing in Laravel.
VI: Revenge of the Fixtures
13m 36sStreamline frontend testing by creating a local-only endpoint to autofill forms with fixtures, saving time and boosting productivity in your Laravel projects.
Post Topics (4)
On the Topic of Posts
16m 54sOrganize your forum posts by building a flexible database structure for topics. Learn how to group content effectively and improve user experience!
Filtering the Index by Topic
12m 24sLearn how to filter your post index by topic using Laravel’s Topic model and write tests to ensure your filter works flawlessly in this Laracasts tutorial.
Crafting a Topic Menu
9m 8sBuild a user-friendly topic menu to easily filter posts on your index. Follow this Laracasts tutorial to enhance navigation and improve UX quickly.
Wiring Up the Form
10m 59sLearn to wire up your form for topic selection by updating PostController methods and tests. Build intuitive Laravel forms with this clear Laracasts tutorial.
House Keeping (5)
Upgrading to Laravel 11
11m 34sKeep your project up-to-date by upgrading to Laravel 11. Learn essential maintenance tips and new features in this friendly, hands-on Laracasts tutorial.
Removing Laravel Sanctum
4m 17sSimplify your Laravel 10 app by removing Sanctum safely. Learn why and how to clean up unused packages in this clear, friendly Laracasts tutorial.
Upgrading Vue
8m 9sUpgrade your Laravel app’s frontend with Vue 3.4! Learn to implement custom model binding improvements in this engaging Laracasts tutorial.
Squashing Bugs
10m 20sBugs happen to everyone! Join this friendly Laracasts tutorial to learn practical tips for finding and fixing bugs in your Laravel applications.
Random Refactors
6m 32sBoost your code’s readability and maintainability with quick, effective refactors. Join this Laracasts video to improve your codebase in just minutes!
Liking Content (5)
Polymorphic Models
17m 37sExplore polymorphic relationships by building a Like model that belongs to posts or comments. Join this friendly Laracasts tutorial to master flexible data structures!
Denormalizing the Database
12m 46sBoost your app’s performance by learning database denormalization to efficiently count likes at scale. Follow this friendly Laracasts tutorial to optimize smartly!
He Likes Me
19m 24sCreate controller logic to let users like posts or comments using polymorphism. Follow this friendly Laracasts tutorial to build flexible, efficient endpoints!
He Likes Me Not
9m 21sAdd unlike functionality to your app with ease by tweaking existing code. Follow this friendly Laracasts tutorial to enhance user interaction and control!
Smash That Like Button
15m 8sWire up your frontend effortlessly with Inertia by creating a Link that acts as a full form. Follow this friendly Laracasts tutorial to boost your app’s interactivity!
Searching for Posts (3)
A Simple Search Solution
9m 22sLearn simple search techniques for forum posts using SQL LIKE queries. Follow this friendly Laracasts tutorial to enhance your app’s search functionality!
Combining Search with Topics
7m 53sFix search bugs by seamlessly combining topics and search in your post index. Follow this friendly Laracasts tutorial to improve your app’s user experience!
Let Scout Do the Searching
17m 47sDiscover how Laravel Scout simplifies search by solving common pitfalls. Learn easy setup and integration tips in this friendly, practical Laracasts tutorial!




