承接 alareqi/wasender-extend 相关项目开发

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

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

alareqi/wasender-extend

Composer 安装命令:

composer require alareqi/wasender-extend

包简介

This package add extended functionality to Wasender

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Wasender Extend is a Laravel package that provides extended functionality for the Wasender WhatsApp messaging platform. This package adds essential API endpoints for WhatsApp session management, QR code generation, and contact verification, making it easier to integrate WhatsApp functionality into your Laravel applications.

Features

  • WhatsApp Contact Verification: Check if a phone number is registered on WhatsApp
  • QR Code Generation: Generate QR codes for WhatsApp Web authentication
  • Session Management: Check and manage WhatsApp session status
  • Device Management: Handle WhatsApp device connections and status
  • API Authentication: Secure API endpoints with user authentication and app key validation
  • Laravel Integration: Seamless integration with Laravel applications using service providers and facades

Requirements

  • PHP 8.4 or higher
  • Laravel 11.0 or 12.0
  • A running WhatsApp server instance (WA_SERVER_URL environment variable)

Installation

You can install the package via Composer:

composer require alareqi/wasender-extend

The package will automatically register its service provider and facade.

Configuration

You can publish the config file with:

php artisan vendor:publish --tag="wasender-extend-config"

This will publish the configuration file to config/wasender-extend.php. Currently, the package uses environment variables for configuration.

Environment Variables

Add the following environment variables to your .env file:

# WhatsApp Server URL (required)
WA_SERVER_URL=http://your-whatsapp-server-url

# Optional: API rate limiting settings
# The package uses Laravel's built-in throttle middleware

Database Requirements

The package expects the following database tables to exist in your application:

  • users table with columns: id, status, will_expire, authkey
  • apps table with columns: id, key, status and relationship to devices
  • devices table with columns: id, status, user_name, phone, qr

These tables should be part of your main Wasender application.

Usage

The package provides three main API endpoints for WhatsApp functionality. All endpoints require authentication via authkey and appkey parameters.

Authentication

All API requests must include:

  • authkey: User authentication key
  • appkey: Application key associated with a WhatsApp device

Available Endpoints

1. Check if Number is on WhatsApp

Endpoint: POST /api/misc/on-whatsapp

Check if a phone number is registered on WhatsApp.

Request:

{
    "authkey": "your-auth-key",
    "appkey": "your-app-key",
    "whatsapp_id": "1234567890"
}

Response:

{
    "status": true,
    "message": "Number is on WhatsApp"
}

2. Generate QR Code

Endpoint: POST /api/qr

Generate a QR code for WhatsApp Web authentication.

Request:

{
    "authkey": "your-auth-key",
    "appkey": "your-app-key"
}

Response:

{
    "qr": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "message": "QR code generated successfully"
}

3. Check Session Status

Endpoint: POST /api/check-session

Check the current WhatsApp session status for a device.

Request:

{
    "authkey": "your-auth-key",
    "appkey": "your-app-key"
}

Response:

{
    "message": "Device Connected Successfully",
    "connected": true,
    "phone": "1234567890"
}

Error Responses

All endpoints may return the following error responses:

401 Unauthorized - Invalid Authentication:

{
    "error": "Invalid Auth and AppKey"
}

401 Validation Error:

{
    "message": "Validation error",
    "errors": {
        "whatsapp_id": ["The whatsapp id field is required."]
    }
}

404 Device Not Found:

{
    "message": "Device not found"
}

Using the Facade

You can also use the package facade in your Laravel application:

use Alareqi\WasenderExtend\Facades\WasenderExtend;

// The facade is available but the main functionality
// is provided through the API endpoints

Using the Command

The package includes a basic Artisan command:

php artisan wasender-extend

Testing

composer test

Run code analysis:

composer analyse

Format code:

composer format

Package Structure

src/
├── Commands/
│   └── WasenderExtendCommand.php     # Artisan command
├── Facades/
│   └── WasenderExtend.php            # Package facade
├── Http/
│   └── Controllers/
│       └── Api/
│           └── MiscController.php    # Main API controller
├── WasenderExtend.php                # Main package class
└── WasenderExtendServiceProvider.php # Service provider

Configuration

The package uses Laravel's service container and is configured through environment variables. The main configuration points are:

  • WA_SERVER_URL: The URL of your WhatsApp server instance
  • Database Models: The package expects User, App, and Device models to exist in your application
  • Middleware: Uses Laravel's built-in throttle:api middleware for rate limiting

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

License

The MIT License (MIT). Please see License File for more information.

alareqi/wasender-extend 适用场景与选型建议

alareqi/wasender-extend 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 09 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「Ayman Alareqi」 「wasender-extend」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 alareqi/wasender-extend 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-16