guanguans/notify
Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NotifyX、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、Z
Maintainers
Fund package maintenance!
Requires
- php: >=8.2
- ext-simplexml: *
- guzzlehttp/guzzle: ^7.10
- guzzlehttp/uri-template: ^1.0
- psr/simple-cache: ^1.0 || ^2.0 || ^3.0
- symfony/options-resolver: ^7.4 || ^8.0
Requires (Dev)
- adamwojs/php-cs-fixer-phpdoc-force-fqcn: ^2.0
- bamarni/composer-bin-plugin: ^1.9
- brainmaestro/composer-git-hooks: ^3.0
- composer/composer: ^2.9
- ergebnis/composer-normalize: ^2.50
- ergebnis/license: ^2.7
- ergebnis/php-cs-fixer-config: ^6.60
- ergebnis/phpstan-rules: ^2.13
- ergebnis/rector-rules: ^1.15
- fakerphp/faker: ^1.24
- guanguans/monorepo-builder-worker: ^3.1
- guanguans/php-cs-fixer-custom-fixers: ^1.2
- guanguans/phpstan-rules: ^1.1
- guanguans/rector-rules: ^1.7
- illuminate/support: ^12.56 || ^13.0
- jbelien/phpstan-sarif-formatter: ^1.2
- mockery/mockery: ^1.6
- mrpunyapal/peststan: ^0.1
- mrpunyapal/rector-pest: ^0.2
- nette/utils: ^4.1
- nicksdot/phpstan-phpstorm-error-identifiers: ^0.3
- pestphp/pest: ^3.8 || ^4.0
- pestphp/pest-plugin-arch: ^3.1 || ^4.0
- php-mock/php-mock-phpunit: ^2.15
- phpbench/phpbench: ^1.6
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-mockery: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpstan/phpstan-webmozart-assert: ^2.0
- phpunit/phpunit: ^11.5 || ^12.0 || ^13.0
- povils/phpmnd: ^3.6
- rector/argtyper: ^0.6
- rector/jack: ^0.5
- rector/swiss-knife: ^2.3
- rector/type-perfect: ^2.1
- roave/backward-compatibility-check: ^8.14
- roave/no-floaters: ^1.13
- shipmonk/composer-dependency-analyser: ^1.8
- shipmonk/dead-code-detector: ^0.15
- shipmonk/name-collision-detector: ^2.1
- shipmonk/phpstan-baseline-per-identifier: ^2.3
- shipmonk/phpstan-rules: ^4.3
- sidz/phpstan-rules: ^0.5
- spatie/invade: ^2.1
- spaze/phpstan-disallowed-calls: ^4.9
- staabm/annotate-pull-request-from-checkstyle: ^1.8
- staabm/phpstan-todo-by: ^0.3
- staabm/side-effects-detector: ^1.0
- symfony/thanks: ^1.4
- symfony/var-dumper: ^7.4 || ^8.0
- symplify/coding-standard: ^13.0
- symplify/easy-coding-standard: ^13.0
- symplify/phpstan-rules: ^14.9
- tomasvotruba/class-leak: ^2.1
- tomasvotruba/cognitive-complexity: ^1.0
- tomasvotruba/ctor: ^2.2
- tomasvotruba/type-coverage: ^2.1
- tomasvotruba/unused-public: ^2.2
- yamadashy/phpstan-friendly-formatter: ^1.4
Suggests
- illuminate/collections: Required to use the method [Response::collect()].
- illuminate/support: Required to use the method [Response::fluent()].
- symfony/var-dumper: Required to use the the trait [WithDumpable].
Provides
Conflicts
None
Replaces
None
MIT ac2146b043b776879867a3c61ad5e269b712ddb6
- guanguans <ityaozm.woop@gmail.com>
sdknotificationbotpushnotifynotifierpushoverqqslackpushbulletgittertelegram微信discorddingtalkMattermost企业微信simplepush钉钉larkweworkrocketchatzulip钉钉群机器人BarkServer酱息知chanifyserverChanxiZhi飞书群机器人飞书企业微信群机器人NtfygoogleChatpushPluspushBackiGotPushDeerQQ 频道机器人一封传话MicrosoftTeamsNowPushShowdocPushYiFengChuanHuaAnPushWPushPushMenotifyxZohoCliqZohoCliqWebHook
This package is auto-updated.
Last update: 2026-06-24 14:38:22 UTC
README
Note
Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NotifyX、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).
👁 tests
👁 php-cs-fixer
👁 codecov
👁 Latest Stable Version
👁 GitHub release (with filter)
👁 Total Downloads
👁 License
Platform support
- AnPush
- Bark
- Chanify
- DingTalk
- Discord
- GoogleChat
- IGot
- Lark
- Mattermost
- MicrosoftTeams
- NotifyX
- Ntfy
- Push
- Pushback
- PushBullet
- PushDeer
- PushMe
- Pushover
- PushPlus
- RocketChat
- ServerChan
- ShowdocPush
- SimplePush
- Slack
- Telegram
- WeWork
- WPush
- XiZhi
- YiFengChuanHua
- ZohoCliq
- ZohoCliqWebHook
- Zulip
Related repositories
Requirement
- PHP >= 8.2
Installation
composer require guanguans/notify -v
Usage example
Quick start
$response = (new Guanguans\Notify\DingTalk\Client( new Guanguans\Notify\DingTalk\Authenticator('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73') )) ->send( Guanguans\Notify\DingTalk\Messages\BtnsActionCardMessage::make([ 'title' => 'This is title(keyword).', 'text' => 'This is text.', ]) ) // ->dump() ->json();
// 1. Create authenticator $authenticator = new Guanguans\Notify\DingTalk\Authenticator( 'c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73', // 'SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51' ); // 2. Create client $client = new Guanguans\Notify\DingTalk\Client($authenticator); // 3. Create message $message = Guanguans\Notify\DingTalk\Messages\BtnsActionCardMessage::make([ 'title' => 'This is title(keyword).', 'text' => 'This is text.', // 'btnOrientation' => 1, // 'btns' => [ // [ // 'title' => 'This is title 1.', // 'actionURL' => 'https://github.com/guanguans/notify', // ], // ], ]) ->btnOrientation(1) ->addBtn([ 'title' => 'This is title 2.', 'actionURL' => 'https://github.com/guanguans/notify', ]); // 4. Send message $response = $client // ->baseUri('base-uri') // ->connectTimeout(10) // ->debug(true) // ->proxy('http://127.0.0.1:1087') // ->timeout(30) // ->verify(false) // ->push( // GuzzleHttp\Middleware::log( // new Psr\Log\NullLogger, // new GuzzleHttp\MessageFormatter(GuzzleHttp\MessageFormatter::DEBUG) // ), // 'log' // ) // ->before( // 'log', // GuzzleHttp\Middleware::mapRequest( // static fn (Psr\Http\Message\RequestInterface $request) => $request // ), // ) ->send($message) ->dump() // ->throw() ->json();
Asynchronous requests
$promise = $client->sendAsync($message); $response = $promise->wait();
Concurrent requests
/** @var iterable<array-key, \Guanguans\Notify\Foundation\Contracts\Message> $messages */ /** @var array<array-key, \Guanguans\Notify\Foundation\Response|\Psr\Http\Message\ResponseInterface> $responses */ $responses = $client->pool($messages);
Hyperf integration
use Guanguans\Notify\Foundation\Client; use GuzzleHttp\HandlerStack; use Hyperf\Guzzle\CoroutineHandler; use Hyperf\Guzzle\HandlerStackFactory; use Hyperf\Guzzle\PoolHandler; // Set Handler directly // $client->setHandler(make(CoroutineHandler::class)); // $client->setHandler(make(PoolHandler::class)); $client->setHandler((fn () => $this->getHandler($this->option))->call(new HandlerStackFactory)); // Or set HandlerStackResolver $client->setHandlerStackResolver(static fn (Client $client): HandlerStack => array_reduce( $client->defaultMiddlewares(), static fn (HandlerStack $handlerStack, callable $middleware) => tap($handlerStack)->push($middleware), (new HandlerStackFactory)->create() ));
Completion
Tip
Required to install Laravel Idea plugin.
Composer scripts
composer checks:required
composer notify:generate-ide-json
composer notify:platform-lint
composer php-cs-fixer:fix
composer test
Benchmark
composer benchmark
+---------------------+--------------------------+-----+-------+-----+----------+-----------+--------+ | benchmark | subject | set | revs | its | mem_peak | mode | rstdev | +---------------------+--------------------------+-----+-------+-----+----------+-----------+--------+ | SendMessageBench | benchSendMessage | | 10000 | 3 | 6.432mb | 156.609μs | ±0.33% | | CreateInstanceBench | benchCreateAuthenticator | | 10000 | 3 | 5.208mb | 0.657μs | ±0.68% | | CreateInstanceBench | benchCreateMessage | | 10000 | 3 | 5.208mb | 1.769μs | ±0.20% | | CreateInstanceBench | benchCreateClient | | 10000 | 3 | 82.791mb | 13.827μs | ±0.40% | +---------------------+--------------------------+-----+-------+-----+----------+-----------+--------+
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
Thanks
License
The MIT License (MIT). Please see License File for more information.
