In this episode, we're focusing on improving the onboarding experience for users who register for the first time in our app. Instead of sending them straight to the dashboard, we want to guide them through an onboarding screen until they've completed the required Stripe onboarding process.
Here's what we cover:
Building the Onboarding Screen: We set up a new controller and route for the onboarding page, create a simple Blade view, and add a button for users to start connecting with Stripe. This is the first step in getting them ready to use the app's full features.
Updating the User Model: We make some database changes to the users
table, adding columns to store the user's Stripe account ID and whether their Stripe account is enabled. This lets us keep track of which users have finished onboarding.
Creating and Applying Middleware: To keep things secure, we write middleware that checks if a user has completed onboarding. If not, they're redirected back to the onboarding screen whenever they try to access protected areas like the dashboard. We add this middleware to the relevant routes and controllers to lock down the app until onboarding is complete.
By the end of this video, our app has a proper onboarding screen, stores which users are onboarded with Stripe, and securely keeps new users from accessing core features until they're ready. Next up, we'll be hooking into the Stripe API to start the real onboarding flow!