1. Go to this page and download the library: Download overtrue/laravel-wechat 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/ */
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);
}
}