Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Laravel Wechat | 2,801 | 345 | 57 | a month ago | 68 | March 31, 2022 | 1 | mit | PHP | |
微信 SDK for Laravel, 基于 overtrue/wechat | ||||||||||
Telegram Bot Sdk | 2,622 | 250 | 47 | 7 days ago | 20 | December 10, 2020 | bsd-3-clause | PHP | ||
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box. | ||||||||||
Firebase Php | 1,905 | 131 | 43 | a day ago | 194 | September 15, 2022 | 8 | mit | PHP | |
Unofficial Firebase Admin SDK for PHP | ||||||||||
Aws Sdk Php Laravel | 1,545 | 443 | 60 | 8 days ago | 26 | March 08, 2022 | 13 | apache-2.0 | PHP | |
A Laravel 5+ (and 4) service provider for the AWS SDK for PHP | ||||||||||
Saloon | 1,294 | 10 days ago | 40 | June 24, 2022 | 5 | mit | PHP | |||
Build beautiful API integrations and SDKs with Saloon 🤠 | ||||||||||
Sentry Laravel | 1,116 | 345 | 69 | 3 days ago | 75 | July 15, 2022 | 10 | mit | PHP | |
The official Laravel SDK for Sentry (sentry.io) | ||||||||||
Laravel Firebase | 764 | 3 | 11 | a month ago | 19 | January 09, 2022 | 1 | mit | PHP | |
A Laravel package for the Firebase PHP Admin SDK | ||||||||||
Laravelfacebooksdk | 697 | 200 | 14 | 3 years ago | 28 | July 23, 2017 | 59 | mit | PHP | |
Fully unit tested Facebook SDK v5 integration for Laravel & Lumen | ||||||||||
Aliyunoss | 462 | 35 | 13 | 3 years ago | 14 | April 06, 2017 | 3 | PHP | ||
阿里云 OSS 官方 SDK 的 Composer 封装,支持任何 PHP 项目,包括 Laravel、Symfony、TinyLara 等等。 | ||||||||||
Forge Sdk | 461 | 9 | 11 | a month ago | 26 | May 31, 2022 | mit | PHP | ||
The official Laravel Forge PHP SDK. |
SDK EasyWeChat for Laravel w7corp/easywechat
7.x Lumen
composer require "overtrue/laravel-wechat"
php artisan vendor:publish --provider="Overtrue\\LaravelWeChat\\ServiceProvider"
'aliases' => [
// ...
'EasyWeChat' => Overtrue\LaravelWeChat\EasyWeChat::class,
],
default
🚨 App\Http\Middleware\VerifyCsrfToken
protected $except = [
// ...
'wechat',
];
Route::any('/wechat', '[email protected]');
Route::any
,GET
,POST
WeChatController
<?php
namespace App\Http\Controllers;
use Log;
class WeChatController extends Controller
{
public function serve()
{
Log::info('request arrived.');
$server = app('easywechat.official_account')->getServer();
$server->with(function($message){
return " overtrue";
});
return $server->serve();
}
}
app/config/easywechat.php
oauth.callback
( 😄)
app/Http/Kernel.php
protected $routeMiddleware = [
// ...
'easywechat.oauth' => \Overtrue\LaravelWeChat\Middleware\OAuthAuthenticate::class,
];
//...
Route::group(['middleware' => ['web', 'easywechat.oauth']], function () {
Route::get('/user', function () {
$user = session('easywechat.oauth_user.default'); //
dd($user);
});
});
'easywechat.oauth:default'
scopes
:
Route::group(['middleware' => ['easywechat.oauth:snsapi_userinfo']], function () {
// ...
});
// scopes:
Route::group(['middleware' => ['easywechat.oauth:default,snsapi_userinfo']], function () {
// ...
});
/user
** ** session('easywechat.oauth_user.default')
use Illuminate\Support\Arr;
use Overtrue\Socialite\User as SocialiteUser;
$user = new SocialiteUser([
'id' => 'mock-openid',
'name' => 'overtrue',
'nickname' => 'overtrue',
'avatar' => 'http://example.com/avatars/overtrue.png',
'email' => null,
'original' => [],
'provider' => 'WeChat',
]);
scope
snsapi_userinfo
snsapi_base
openid
OAuth
session(['easywechat.oauth_user.default' => $user]); // `default`
Overtrue\LaravelWeChat\Events\WeChatUserAuthorized
//
$event->user; // session('easywechat.oauth_user.default')
$event->isNewSession; // session true
$event->account; //
Overtrue\LaravelWeChat\Traits\HandleOpenPlatformServerEvents
routes/web.php:
Route::any('/open-platform/server', OpenPlatformController::class);
app/Http/Controllers/OpenPlatformController.php:
<?php
namespace App\Http\Controllers;
use Overtrue\LaravelWeChat\Traits\HandleOpenPlatformServerEvents;
class OpenPlatformController extends Controller
{
use HandleOpenPlatformServerEvents;
public function __invoke(Application $application): \Psr\Http\Message\ResponseInterface
{
$app = app('easywechat.open_platform');
return $this->handleServerEvents($app);
}
}
Tips:
Overtrue\LaravelWeChat\Events\OpenPlatform\Authorized
Overtrue\LaravelWeChat\Events\OpenPlatform\AuthorizeUpdated
Overtrue\LaravelWeChat\Events\OpenPlatform\Unauthorized
Overtrue\LaravelWeChat\Events\OpenPlatform\VerifyTicketRefreshed
//
$message = $event->payload; //
http://example.com/open-platform/server
URL
SDK https://www.easywechat.com
Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.
PHP
MIT