ges / laravel-green-api
Core Green API integration for Laravel.
v0.1.0
2026-03-14 22:53 UTC
Requires
- php: ^8.3
- laravel/framework: ^12.0
- spatie/laravel-package-tools: ^1.92
Requires (Dev)
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.5
README
Laravel package for Green API inbound webhooks, outbound messaging, and a persisted WhatsApp-like inbox model.
Install
composer require ges/laravel-green-api php artisan laravel-green-api:install php artisan migrate
Configuration
Publish the config file and set the Green API credentials:
GREEN_API_URL= GREEN_API_MEDIA_URL= GREEN_API_INSTANCE_ID= GREEN_API_TOKEN= GREEN_API_TEST_CHAT_ID= GREEN_API_WEBHOOK_URL= GREEN_API_WEBHOOK_AUTHORIZATION_HEADER=
The package uses App\Models\User as the default contact model and adds a dynamic greenApiConversation relation automatically at boot.
Commands
php artisan green-api:check-connection php artisan green-api:sync-webhook
Usage
use Ges\LaravelGreenApi\Services\GreenApiInboxService; $inbox = app(GreenApiInboxService::class); $message = $inbox->sendTextMessage($user, 'Hello'); $conversation = $user->greenApiConversation;
Inbound webhooks are exposed at POST /green-api/webhook.