submtd/social-login

Login and register Laravel users with social media accounts

1.0.4 2018-06-27 20:02 UTC

This package is auto-updated.

Last update: 2024-04-13 11:30:49 UTC


README

This package enables login and registration for users via social media in your Laravel app using the Laravel Socialite package.

Installation

Begin by pulling in the package through Composer.

composer require submtd/social-login

Next, if you are using Laravel 5.4, you will need to include the service provider in your config/app.php file. If you are using Laravel 5.5, these will be discovered automatically.

'providers' => [
    Submtd\SocialLogin\Providers\SocialLoginServiceProvider::class,
];

Next, you will need to run the migrations in order to create the social_login_ids table.

php artisan migrate

Next, in order to see the status messages generated by this package, you will need to add the following code to your applications main blade template file.

@if(session('status'))
    <div class="alert">
        {{ session('status') }}
    </div>
@endif

Finally, some links will need to be created for each provider you would like to use.

<a href="/auth/social/bitbucket">Log in with Bitbucket</a>
<a href="/auth/social/facebook">Log in with Facebook</a>
<a href="/auth/social/github">Log in with Github</a>
<a href="/auth/social/google">Log in with Google</a>
<a href="/auth/social/twitter">Log in with Twitter</a>

Configuration

If you would like to edit the configuration, you must run the following artisan command to copy the config file to your app directory.

php artisan vendor:publish --provider="Submtd\SocialLogin\Providers\SocialLoginServiceProvider"

After running this command, the status messages can be found in config/social-login.php.

If you would like to only publish the config or the migrations, use the --tag option on the artisan command.

php artisan vendor:publish --provider="Submtd\SocialLogin\Providers\SocialLoginServiceProvider" --tag=config
php artisan vendor:publish --provider="Submtd\SocialLogin\Providers\SocialLoginServiceProvider" --tag=migrations

Configuring Authentication Providers

Authentication provider configuration is stored in config/services.php. More information on configuring the providers can be found on the Laravel Socialite Documentation page.

Donation

If this project helped you save some development time, feel free to buy me a beer ;)

paypal