PHP code example of altivium / laravel-socialite-meli

1. Go to this page and download the library: Download altivium/laravel-socialite-meli library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

altivium / laravel-socialite-meli example snippets


composer 


// config/services.php
'meli' => [
    'client_id' => env('MELI_CLIENT_ID'),
    'client_secret' => env('MELI_CLIENT_SECRET'),
    'redirect' => env('MELI_REDIRECT'),
],



// config/app.php
    'providers' => [ // ......
        /*
         * Package Service Providers...
         */
        Altivium\MeliSocialite\MeliSocialiteServiceProvider::class


use Laravel\Socialite\Facades\Socialite;

Route::get('/auth/redirect', function () {
    return Socialite::driver('meli')->redirect();
});

Route::get('/auth/callback', function () {
    $user = Socialite::driver('meli')->user();

    // $user->token
});