larbrary/tawk
Laravel package for integrating Tawk.to live chat into your app. Provides simple setup to add the Tawk widget to your views, configure your property ID, and enable customer support chat with minimal code.
onMessage, onVisitorReady), which could be extended via Laravel’s event system for deeper integration (e.g., logging, analytics).beyondcode/laravel-websockets) that could complement or replace this for real-time features?onMessage) into Laravel’s event bus for analytics or notifications?window.Tawk_API).x-data for Alpine).Auth::user()->id) via Tawk.to’s setAttributes()..env or a config file (e.g., config/tawk.php).Event facade to listen to Tawk.to callbacks (e.g., TawkMessageReceived).composer require larbrary/tawk.php artisan vendor:publish --provider="Larbrary\Tawk\TawkServiceProvider".@tawk.TawkManager to fetch property ID from database or API.Tawk::setAttributes(['email' => auth()->user()->email]).TawkMessageReceived to trigger Laravel notifications.composer.json for exact requirements).php -v).| Step | Task | Dependencies |
|---|---|---|
| 1 | Install package | Composer, Laravel project |
| 2 | Configure .env |
Tawk.to property ID |
| 3 | Publish config | vendor:publish |
| 4 | Blade integration | @tawk directive |
| 5 | Test widget | Browser console (check Tawk_API object) |
| 6 | Add user metadata | Auth system, setAttributes() |
| 7 | Event listeners | Laravel events, Tawk.to callbacks |
| 8 | Monitor performance | Lighthouse, real-user metrics |
larbrary/tawk for updates (though low activity may require manual forks).tawk_config table) to avoid hardcoded values.Tawk_API and Laravel logs for errors.defer or async for the script tag to avoid render-blocking.propertyId is tenant-specific.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Tawk.to CDN down | Widget unavailable | Fallback: Static "Chat unavailable" message |
| JavaScript errors | Widget broken | Feature detection; graceful degradation |
| API rate limits | Data sync failures | Implement retries with exponential backoff |
| GDPR compliance gap | Legal risk | Add opt-out cookie banner; anonymize data |
| Package abandonment | No updates | Fork repository; submit PRs to maintainer |
How can I help you explore Laravel packages today?