kawax / socialite-amazon by revolution

Socialite for Login with Amazon
95,190
14
3
Package Data
Maintainer Username: revolution
Maintainer Contact: kawaxbiz@gmail.com (kawax)
Package Create Date: 2017-09-13
Package Last Update: 2024-10-02
Language: PHP
License: MIT
Last Refreshed: 2024-12-21 03:00:21
Package Statistics
Total Downloads: 95,190
Monthly Downloads: 3,147
Daily Downloads: 67
Total Stars: 14
Total Watchers: 3
Total Forks: 5
Total Open Issues: 0

Socialite for Login with Amazon

https://login.amazon.com/

Installation

composer require revolution/socialite-amazon

config/services.php

    'amazon' => [
        'client_id'     => env('AMAZON_LOGIN_ID'),
        'client_secret' => env('AMAZON_LOGIN_SECRET'),
        'redirect'      => env('AMAZON_LOGIN_REDIRECT'),
    ],

.env

AMAZON_LOGIN_ID=
AMAZON_LOGIN_SECRET=
AMAZON_LOGIN_REDIRECT=

Usage

routes/web.php

Route::get('/', 'AmazonController@index');
Route::get('callback', 'AmazonController@callback');

AmazonController

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Laravel\Socialite\Facades\Socialite;

class AmazonController extends Controller
{
    public function index()
    {
        return Socialite::driver('amazon')->redirect();
    }

    public function callback()
    {
        $user = Socialite::driver('amazon')->user();
        dd($user);
    }
}

LICENCE

MIT Copyright (c) 2017 kawax