Download the PHP package dantepiazza/laravel-chatwoot without Composer
On this page you can find all versions of the php package dantepiazza/laravel-chatwoot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dantepiazza/laravel-chatwoot
More information about dantepiazza/laravel-chatwoot
Files in dantepiazza/laravel-chatwoot
Package laravel-chatwoot
Short Description Laravel integration for Chatwoot – webhook routing, bot workflow engine and Chatwoot API helpers.
License MIT
Informations about the package laravel-chatwoot
dantepiazza/laravel-chatwoot
Laravel integration for Chatwoot — webhook routing, a step-based bot workflow engine and Chatwoot API helpers.
Requirements
- PHP 8.1+
- Laravel 10 / 11 / 12
dantepiazza/laravel-api-response
Installation
Publish the config file:
Publish the example workflow:
Environment variables
Add these to your .env:
How it works
1. Webhook route
The package registers the following route automatically:
The {flow} segment is resolved to a class:
You can have multiple workflows for different inboxes.
2. Creating a workflow
A workflow is a class that extends ChatwootProvider and lives in app/Services/Chatwoot/.
The published stub (BotWorkflow.php) is a ready-to-run example. Here is the minimal structure:
3. Steps
Every step is a method named step_{name} where dots in the step name become underscores:
| Step name | Method |
|---|---|
welcome.start |
step_welcome_start() |
docs.start |
step_docs_start() |
affiliate.menu |
step_affiliate_menu() |
4. Navigating between steps
5. Sending messages
6. Actions
A step can have a sub-state called an action, encoded as step.name[action].
This is useful to handle confirmation flows or multi-stage interactions within the same logical step.
7. Built-in helpers (via HasCommonFlows trait)
attach(string $message, string $cancelStep)
Manages a multi-message file-upload flow. Returns true once the user confirms they have finished sending files.
open(array $tags, int $team, string $message, string $nextStep)
Adds tags, assigns a team, opens the conversation and notifies the user.
goodbye(string $message, array $buttons)
Sends a closing message and asks if the user needs anything else.
8. Other API methods
| Method | Description |
|---|---|
$this->status('open') |
Toggle conversation status |
$this->tag(['label']) |
Add labels to the conversation |
$this->team(1) |
Assign to a team |
$this->attribute('key', val) |
Set a custom attribute |
$this->wait(2) |
Sleep N seconds (useful between messages) |
Development mode
Set $this->development = true in your workflow constructor to allow the bot to respond even when a conversation is open. Useful when testing in Chatwoot directly. Remove before deploying to production.
Contributing
- Fork the repository from the
masterbranch. - Create a branch for your feature or fix.
- Follow PSR-12 coding standards.
- Submit a pull request describing your changes.
License
MIT
All versions of laravel-chatwoot with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^10.0|^11.0|^12.0
dantepiazza/laravel-api-response Version ^1.0.0