tocaan/gowasl-package
Composer 安装命令:
composer require tocaan/gowasl-package
包简介
simple laravel package to connect your whatsapp and send messages
README 文档
README
simple laravel package to connect your whatsapp and send messages.
Installation
composer require tocaan/gowasl-package
After updating composer, add the ServiceProvider to the providers array in config/app.php.
WAIntegration\WAServiceProvider::class,
Optionally you can use the Facade for shorter code. Add this to your facades:
'Instance' => WAIntegration\Facades\InstanceFacade::class,
'Message' => WAIntegration\Facades\MessageFacade::class,
more is coming soon.
Finally you can publish the config file:
php artisan vendor:publish --provider="WAIntegration\WAServiceProvider"
Configuration
The main change to this config file (config/wa_integration.php) will be filled with your channel credentials.
For example, when loaded with composer, the line should look like:
'id' => env('WA_CHANNEL_ID','YOUR_CHANNEL_ID_HERE'),
'token' => env('WA_CHANNEL_TOKEN','YOUR_CHANNEL_TOKEN_HERE'),
'identifier' => env('WA_CHANNEL_IDENTIFIER','YOUR_CHANNEL_OWNER_IDENTIFIER_HERE'),
Usage
You can create a new (Message or Instance) instance and begin sending messages or fetching qr & account activity status.
Use the facade:
- Instance Facade
Instace::qr()
To fetch current qr
Instance::status()
To Check If account status is active or disconnected
Instance::disconnect()
Disconnect Channel Connection
Instance::clearInstance()
Delete Channel, becareful when trying to use it
Instance::clearInstanceData()
Clear all files associated with channel
- Message Facade
- Send Text Message Via Whatsapp
Message::send([
'phone' => '965xxxxxxxx',
'body' => 'Your Message Body Here'
])
- Send Multi-Media Message Via Whatsapp
- Image
Message::sendImage([
'phone' => '965xxxxxxxx',
'url' => 'url of your image',
'caption' => 'image caption (optional)'
])
- Video
Message::sendVideo([
'phone' => '965xxxxxxxx',
'url' => 'url of your video',
'caption' => 'image caption (optional)'
])
- Audio
Message::sendAudio([
'phone' => '965xxxxxxxx',
'url' => 'url of your audio file',
])
- Document
Message::sendFile([
'phone' => '965xxxxxxxx',
'url' => 'url of your document file',
])
- Link
Message::sendLink([
'phone' => '965xxxxxxxx',
'url' => 'HTTPS URL',
'title' => 'URL Title',
'body' => 'URL Description',
])
- Sticker
Message::sendSticker([
'phone' => '965xxxxxxxx',
'url' => 'url of your Sticker',
])
- Gif
Message::sendGif([
'phone' => '965xxxxxxxx',
'url' => 'url of your Gif',
'caption' => 'Gif caption (optional)'
])
- Location
Message::sendLocation([
'phone' => '965xxxxxxxx',
'lat' => 'location latitude',
'lng' => 'location longitude'
])
- Contact
Message::sendContact([
'phone' => '965xxxxxxxx',
'name' => 'Contact Name',
'contact' => 'Contact Whatsapp Number',
'organization' => 'Contact Organization (optional)',
])
- Mention
Message::sendMention([
'phone' => '965xxxxxxxx',
'mention' => 'Mention Whatsapp Number',
])
Note: Your Connection status must be connected it means that you had already scanned QR.
tocaan/gowasl-package 适用场景与选型建议
tocaan/gowasl-package 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 277 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 10 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tocaan/gowasl-package 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tocaan/gowasl-package 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 277
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-10-23