carpool-logistics / laravel-heymarket
该包的最新版本(1.0.1)没有提供许可证信息。
Laravel Heymarket API 的包
1.0.1
2024-08-06 22:42 UTC
Requires
- guzzlehttp/guzzle: ^7.0
- illuminate/support: ^8.0|^9.0|^10.0
README
Laravel Heymarket API 集成包。
安装
composer require carpool-logistics/laravel-heymarket
配置
发布配置文件
php artisan vendor:publish --provider="CarpoolLogistics\Heymarket\HeymarketServiceProvider"
在 .env 文件中设置您的 Heymarket API 密钥
HEYMARKET_API_KEY=your_api_key
HEYMARKET_CREATOR_ID=creator_id
HEYMARKET_INBOX_ID=inbox_id
使用
在 Laravel 通知中使用该包
use CarpoolLogistics\Heymarket\HeymarketChannel; use CarpoolLogistics\Heymarket\HeymarketMessage; class OrderShipped extends Notification { public function via($notifiable) { return [HeymarketChannel::class]; } public function toHeymarket($notifiable) { return [ HeymarketMessage::create() ->to($notifiable->phone_number) ->body('Your order has been shipped!') ->creatorId('your_creator_id') ->inboxId('your_team_id'), HeymarketMessage::create() ->to($notifiable->phone_number) ->body('Your order tracking number is 12345') ->inboxId('your_inbox_id') ->creatorId('your_creator_id') ->mediaUrl('https://images.com/image') ]; } }