In this episode, we're kicking things off by setting up a brand new Laravel app specifically for handling user subdomains. We walk through installing a fresh Laravel project and then pull in Laravel Breeze as our starter kit so we have some out-of-the-box authentication and profile pages to work with.
Next up, we configure our database connection so everything's good to go, then run the default migrations to set up the usual tables like users
. Once that's done, we dive into installing Laravel Breeze (using the Blade stack for simplicity), get our front-end dependencies sorted with npm install
and npm run dev
, and confirm our app is running locally.
One thing to note: we touch on how Laravel plays with wildcard subdomains, but how this works depends a little on your local setup. So if you plan to test subdomains, you may need to do some quick research or configuration for your environment.
To wrap things up, we add a subdomain
column to the users table with a dedicated migration — making sure it's unique and nullable, since users won't set this during registration, but will update it later in their profile. We run the migration and get everything ready for the next episode, where we'll add UI so users can actually pick their subdomain.