Download the PHP package alareqi/wasender-extend without Composer
On this page you can find all versions of the php package alareqi/wasender-extend. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alareqi/wasender-extend
More information about alareqi/wasender-extend
Files in alareqi/wasender-extend
Package wasender-extend
Short Description This package add extended functionality to Wasender
License MIT
Homepage https://github.com/aymanalareqi/wasender-extend
Informations about the package wasender-extend
Wasender Extend
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:
The package will automatically register its service provider and facade.
Configuration
You can publish the config file with:
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:
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 todevices
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 keyappkey
: 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:
Response:
2. Generate QR Code
Endpoint: POST /api/qr
Generate a QR code for WhatsApp Web authentication.
Request:
Response:
3. Check Session Status
Endpoint: POST /api/check-session
Check the current WhatsApp session status for a device.
Request:
Response:
Error Responses
All endpoints may return the following error responses:
401 Unauthorized - Invalid Authentication:
401 Validation Error:
404 Device Not Found:
Using the Facade
You can also use the package facade in your Laravel application:
Using the Command
The package includes a basic Artisan command:
Testing
Run code analysis:
Format code:
Package Structure
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
, andDevice
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
- Ayman Alareqi
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of wasender-extend with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0