revolution / socialite-amazon
Socialite for Login with Amazon
Installs: 92 054
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 3
Forks: 5
Open Issues: 0
Requires
- php: ^8.0
- ext-json: *
- laravel/socialite: *
Requires (Dev)
- orchestra/testbench: ^9.0
README
Requirements
- PHP >= 8.0
No version restrictions. It may stop working in future versions.
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::class, 'index']); Route::get('callback', [AmazonController::class, '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