Download the PHP package vntrungld/laravel-crisp without Composer
On this page you can find all versions of the php package vntrungld/laravel-crisp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vntrungld/laravel-crisp
More information about vntrungld/laravel-crisp
Files in vntrungld/laravel-crisp
Package laravel-crisp
Short Description A Laravel package for seamless integration with Crisp Chat API including webhook handling and signature verification
License MIT
Homepage https://github.com/vntrungld/laravel-crisp
Informations about the package laravel-crisp
Laravel Crisp
A Laravel package that provides a seamless integration with Crisp Chat. This package wraps the official Crisp PHP API client and adds Laravel-specific features like webhook handling with signature verification.
Features
- ๐ Easy integration with Crisp Chat API
- ๐ Webhook signature verification for security
- ๐ข Event-driven webhook handling
- โ๏ธ Configurable webhook endpoints
- ๐ฏ Laravel 9+ support
- ๐งช Comprehensive test coverage
Requirements
- PHP 8.1 or higher
- Laravel 9.0 or higher
Installation
Install the package via Composer:
The package will automatically register its service provider.
Publish Configuration
Publish the configuration file:
This will create a config/crisp.php file in your application.
Configuration
Add the following environment variables to your .env file:
Configuration Options
tier: The Crisp API tier (default:plugin)token_id: Your Crisp API token identifiertoken_key: Your Crisp API token keysigning_secret: Secret for webhook signature verificationwebhook_path: Base path for webhook routes (default:crisp)plugin_id: Your Crisp plugin identifier
Usage
Using the Crisp Client
You can access the Crisp client in several ways:
Via Facade
Via Dependency Injection
Via Container
Handling Webhooks
The package automatically registers a webhook endpoint at /crisp/webhook (or your custom path).
Webhook Signature Verification
Webhook signature verification is automatically enabled when you set CRISP_SIGNING_SECRET. This ensures that incoming webhooks are genuinely from Crisp.
The middleware will:
- Extract the timestamp and signature from request headers
- Compute the expected signature using HMAC-SHA256
- Compare signatures using a timing-safe comparison
- Reject requests with invalid signatures (401 response)
Listening to Webhook Events
When a webhook is received, a WebhookReceived event is dispatched. You can listen to this event in your application:
Or create a dedicated listener:
Register the listener in your EventServiceProvider:
Crisp API Examples
For detailed API documentation, refer to the official Crisp API documentation.
Get Website Conversations
Get Conversation Messages
Send a Text Message
Update Conversation Meta
Testing
The package includes comprehensive tests covering all major functionality:
Running Tests for Specific Laravel Versions
The package supports Laravel 9, 10, 11, and 12. The test suite runs against all versions in CI.
To test locally with a specific Laravel version:
Laravel Version Support
| Laravel Version | PHP Version | Package Support |
|---|---|---|
| 9.x | 8.1, 8.2 | โ |
| 10.x | 8.1, 8.2, 8.3 | โ |
| 11.x | 8.2, 8.3 | โ |
| 12.x | 8.2, 8.3 | โ |
The minimum supported Laravel version is 9.0.
Security
Webhook Signature Verification
Always set CRISP_SIGNING_SECRET in production to ensure webhook authenticity. Without this, anyone could send fake webhooks to your application.
Reporting Security Issues
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Change Log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
Credits
- vntrungld
- All Contributors
License
MIT. Please see the license file for more information.
All versions of laravel-crisp with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
crispchat/php-crisp-api Version ^1.7
symfony/http-client Version ^6.0|^7.0
php-http/httplug Version ^2.4
nyholm/psr7 Version ^1.8