revolution / socialite-chatwork
This package is abandoned and no longer maintained.
No replacement package was suggested.
Socialite for ChatWork
1.2.2
2020-03-04 13:50 UTC
Requires
- php: ^7.2||^8.0
- ext-json: *
- laravel/socialite: *
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ^4.0||^5.0
- phpunit/phpunit: ^8.0||^9.0
README
http://developer.chatwork.com/ja/
Requirements
- PHP >= 7.2
Installation
composer require revolution/socialite-chatwork
config/services.php
'chatwork' => [
'client_id' => env('CHATWORK_CLIENT_ID'),
'client_secret' => env('CHATWORK_CLIENT_SECRET'),
'redirect' => env('CHATWORK_REDIRECT'),
],
.env
CHATWORK_CLIENT_ID=
CHATWORK_CLIENT_SECRET=
CHATWORK_REDIRECT=
Usage
routes/web.php
Route::get('login', 'ChatWorkController@login');
Route::get('callback', 'ChatWorkController@callback');
ChatWorkController
namespace App\Http\Controllers; use Illuminate\Http\Request; use Socialite; class ChatWorkController extends Controller { public function login() { return Socialite::driver('chatwork')->redirect(); } public function callback() { $user = Socialite::driver('chatwork')->user(); dd($user); } }
Scopes
http://developer.chatwork.com/ja/oauth.html#secAppendix
public function login() { return Socialite::driver('chatwork') ->setScopes(['users.all:read']) ->redirect(); }
Demo
https://github.com/kawax/socialite-project
LICENCE
MIT Copyright kawax