Integrate Ping2me with PHP app or Laravel with official SDK
PHP app
You can check the official SDK ping2me/php
Install
bash
composer require ping2me/phpcomposer require ping2me/phpUsage
Setup the endpoint at very first of your PHP app
php
\Ping2Me\Php\Ping::$endpoint = '@your_end_point'; // example: @david/telegram\Ping2Me\Php\Ping::$endpoint = '@your_end_point'; // example: @david/telegramThen you can send notification to your chat app like this
php
\Ping2Me\Php\Ping::make()->send('Hello world');
// or simply use helper function
ping('hello world');\Ping2Me\Php\Ping::make()->send('Hello world');
// or simply use helper function
ping('hello world');Laravel app
We also have a Laravel package ping2me/laravel
Install
bash
composer require ping2me/laravelcomposer require ping2me/laravelConfiguration
Update your config/services.php file with the following:
php
// other services
'ping2me' => [
'endpoint' => env('PING2ME_ENDPOINT'),
],// other services
'ping2me' => [
'endpoint' => env('PING2ME_ENDPOINT'),
],So you can set up your endpoint in your .env file:
dotenv
PING2ME_ENDPOINT=@daudau/ping2mePING2ME_ENDPOINT=@daudau/ping2meUsage
php
\Ping2Me\Laravel\Facades\Ping::send('Hello world!');
// or
ping('Hello world!');\Ping2Me\Laravel\Facades\Ping::send('Hello world!');
// or
ping('Hello world!');