This episode is for members only

Sign up to access "Social Authentication with Laravel" right now.

Get started
Already a member? Sign in to continue
Playing
02. Setting up

Transcript

00:00
okay so if you're new to Laravel let's go through and set up a fresh project with Laravel Breeze which is just a starter kit for Laravel, it doesn't matter if you're not using Laravel Breeze here, you can pretty much use anything, everything that we're covering here pretty much applies, so let's go and start this out with a fresh project, so let's go ahead and use
00:19
Laravel New and we'll give this a name, I'm going to call it Laravel Socialite and let's go ahead and choose Laravel Breeze as the starter kit and we're not using any particular framework here, we're just going to use Blade with Alpine and we can run through any of these options, these don't really matter, okay so let's wait for this to prompt us about
00:37
our database and we're going to go ahead and choose MySQL, so let's go ahead and hit enter on MySQL and let's just wait for this to finish, okay now that's done we've got a fresh Laravel app, let's open this up in the browser and sure enough we've got the ability to register and log in, now we are going to do that now but we're going to change some stuff up a little bit later
00:57
so we're going to create a new view which will allow us to see the options to click to sign in for different services but for now let's just get everything set up, make sure that the database is hooked up properly and we'll be good to go, okay so the first thing that we want to do is head over to the env file and we're going to come down to the database section and just make sure that all
01:17
of your connection settings are good and then we're going to run our default migrations which will create out the users table and a couple of other tables, so we're going to go ahead and run php artisan migrate if your database doesn't exist this will prompt you and sure enough if we head over that is now created and we have our users table in there and like I said we will be
01:36
modifying this table later because for each service we're going to want to add the id of the service that we're using for example an x id a github id and any of the other services that you use but we'll roll through that a little bit later, okay so now that we have our database created we can go ahead and sign in the normal way and we're not going to disable this we're just going to use
01:58
this as another option so now that we're signed in you can see that we're on our dashboard great okay that is to be honest pretty much all we're doing right now in the next section we're going to look at the very basics of laravel socialite how to install it how to get set up and really importantly how to redirect over to the service that you want to use so let's cover that next

Episode summary

In this episode, we kick things off by setting up a brand new Laravel project. If you're a Laravel beginner, don't worry—I'll walk you through every step so you can follow along easily!

We start by creating a fresh Laravel app and select Laravel Breeze as our starter kit. This gives us a ready-to-go registration and login system right out of the box (but don’t sweat it if you’re not using Breeze, everything here still applies). For simplicity, we stick with the Blade and Alpine setup and pick MySQL as our database.

Once the app is set up, we take a peek in the browser to check that things look good, and sure enough, registration and login work. We then pop into the .env file to double-check the database settings, then run our migrations to create the default tables (like users) in the database. If your database doesn’t exist, Laravel will prompt you as you go.

At this point, we’ve got a working login system, but we’ll be tweaking things soon—particularly the user table to store social account IDs (like GitHub or X ID) later on. For now though, we leave the normal login/registration in place as an extra option.

That’s the basic setup sorted! Next up, we’ll get into the essentials of Laravel Socialite, including installing it and getting ready to let users authenticate with their favorite social services.

Episode discussion

No comments, yet. Be the first!