ges / filament-green-api
Filament admin pages for configuring and using the Laravel Green API package.
Requires
- php: ^8.4
- filament/filament: ^3.3
- ges/laravel-green-api: ^0.1
- spatie/laravel-package-tools: ^1.92
Requires (Dev)
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.5
README
Filament v3 panel plugin for configuring and using ges/laravel-green-api from the Filament admin.
Installation
composer require ges/filament-green-api
Publish the plugin config:
php artisan vendor:publish --tag="filament-green-api-config"
If you have not already installed the base Green API package, run its installer:
php artisan green-api:install
Publish Filament assets so the plugin stylesheet is available in your panel:
php artisan filament:assets
If you prefer publishing manually, use the dependency package tags:
php artisan vendor:publish --tag="laravel-green-api-config" php artisan vendor:publish --tag="laravel-green-api-migrations" php artisan migrate
Register The Plugin
Register the plugin in your Filament panel provider:
<?php namespace App\Providers\Filament; use Filament\Panel; use Filament\PanelProvider; use Ges\FilamentGreenApi\GreenApiPlugin; class AdminPanelProvider extends PanelProvider { public function panel(Panel $panel): Panel { return $panel ->plugins([ GreenApiPlugin::make(), ]); } }
Required Green API Configuration
This plugin depends on ges/laravel-green-api for transport, webhook handling, models, and contact resolution.
At minimum, make sure these values are configured in config/green_api.php or your environment:
api_urlmedia_urlinstance_idtokencontact_modelcontact_phone_attribute
If your contact model does not use a phone column, update contact_phone_attribute before opening the inbox page.
Plugin Configuration
The plugin publishes config/green_api_filament.php with:
return [ 'pages' => [ 'settings' => [ 'view_ability' => null, 'navigation_icon' => 'heroicon-o-cog-6-tooth', 'navigation_group' => 'Communication', 'navigation_sort' => 1, ], 'whatsapp' => [ 'view_ability' => null, 'navigation_icon' => 'heroicon-o-chat-bubble-left-right', 'navigation_group' => 'Communication', 'navigation_sort' => 2, ], ], ];
Set pages.settings.view_ability to restrict the configuration page and pages.whatsapp.view_ability to restrict the WhatsApp inbox page.
Use pages.settings and pages.whatsapp to configure each page's access, navigation icon, group, and sort order independently.