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
12 episodes•1 hr 4 mins•1 year ago
Overview
Need to add social authentication to your Laravel apps? It’s almost zero effort using Laravel Socialite.
We start with the basics, add authentication with one provider, then use a design pattern to make adding additional services a breeze.