承接 zapmizer/laravel-notification-zapmizer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zapmizer/laravel-notification-zapmizer

Composer 安装命令:

composer require zapmizer/laravel-notification-zapmizer

包简介

A Laravel package to send WhatsApp notifications using Zapmizer API

README 文档

README

Installation

You can install the package via composer:

composer require zapmizer/laravel-notification-zapmizer

Now publish config file

php artisan vendor:publish --provider="Notification\Zapmizer\ZapmizerServiceProvider" --tag=config --force

Setting up your Zapmizer account

  1. Create a API TOKEN.
  2. Paste your API token in your zapmizer.php config file.
  3. Add environment viariables with values
    ZAPMIZER_API_TOKEN="your-api-token"
    ZAPMIZER_FROM_NUMBER="558181643260"

Usage

In every Notification you wish to notify via WhatsApp, you must add a toZapmizer function and add 'zapmizer' drive into via's array:

    /**
     * Get the notification's delivery channels.
     *
     * @return array<int, string>
     */
    public function via(object $notifiable): array
    {
        return ['mail', 'zapmizer'];
    }

    /**
     * Get the WhatsApp representation of the notification.
     */
    public function toZapmizer(object $notifiable)
    {
        $message = 'This is a message!' . PHP_EOL;

        //WID must follow the WhatsApp pattern, example: 558181643260; 558181643260@c.us 128172192@g.us(groups)

        return ZapmizerMessage::create(from: config('zapmizer.from_number'), to: $notifiable->wid)->type('chat')->text($message)->send();
    }

Number verification

Mirroring Laravel's MustVerifyEmail: implement an interface and use a trait on your User model, and it gains the verification methods you'd expect. The user verifies through a hosted page on the Zapmizer domain — they message the team's WhatsApp number via wa.me and type back the code the bot replies with. Your app confirms the code (hosted page or your own input) and/or receives the terminal state on the team's webhooks. State lives in the package's own tables — your users table is never touched.

use NotificationChannels\Zapmizer\Contracts\MustVerifyWhatsapp as MustVerifyWhatsappContract;
use NotificationChannels\Zapmizer\MustVerifyWhatsapp;

class User extends Authenticatable implements MustVerifyWhatsappContract
{
    use MustVerifyWhatsapp;
}
<a href="{{ route('zapmizer.verify_number') }}">Verify your WhatsApp</a>
$user->hasVerifiedWhatsapp(); // true after the user completes the hosted page

See the full setup guide — credentials, env vars, migrations, User model, signed return URL, confirmation webhook and events — in docs/verify-number.md.

zapmizer/laravel-notification-zapmizer 适用场景与选型建议

zapmizer/laravel-notification-zapmizer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.92k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 07 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 zapmizer/laravel-notification-zapmizer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 zapmizer/laravel-notification-zapmizer 我们能提供哪些服务?
定制开发 / 二次开发

基于 zapmizer/laravel-notification-zapmizer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.92k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-18