leroy-merlin-br/lmbr-socialite-driver

Leroy Merlin Brazil driver for Laravel Socialite

1.1.0 2018-03-06 20:26 UTC

This package is auto-updated.

Last update: 2022-05-23 22:12:31 UTC


README

Latest Version on Packagist

Installation

You can install the package via composer:

composer require leroy-merlin-br/lmbr-socialite-driver

This service provider must be installed. Skip if you are using Laravel 5.5+, this driver comes with auto discovery for providers.

// config/app.php
'providers' => [
    ...
    LeroyMerlin\Socialite\ServiceProvider::class,
];

Configuration and Usage

Just follow the Socialite Documentation using leroy-merlin on your config/services.php and driver. For example:

// config/services.php
'leroy-merlin' => [
    'client_id' => env('LMBR_CLIENT_ID'),         // Your Leroy Merlin Client ID
    'client_secret' => env('LMBR_CLIENT_SECRET'), // Your Leroy Merlin Client Secret
    'redirect' => 'http://your-callback-url',
],
public function redirectToProvider()
{
    return Socialite::driver('leroy-merlin')->redirect();
}

public function handleProviderCallback()
{
    $user = Socialite::driver('leroy-merlin')->user();

    // $user->getName();
    // $user->getEmail();
}