larbrary / tawk
Website chat widget (tawk.to integration for Laravel).
Installs: 45
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Type:laravel-package
Requires
- php: >=5.6.0
- illuminate/support: ~5|~6|~7|~8
- illuminate/view: ~5|~6|~7|~8
Requires (Dev)
- orchestra/testbench: ~5|~6
- phpunit/phpunit: ~8|~9
This package is auto-updated.
Last update: 2024-10-30 02:05:01 UTC
README
The missing integration of tawk.to chat widget for Laravel.
Installation
Via Composer:
$ composer require larbrary/tawk
Laravel 5.5+ will use the auto-discovery function but for Laravel 5.4 and lower, you will need to include the service providers & facade manually in config/app.php
:
'providers' => [ // ..., Larbrary\Tawk\TawkServiceProvider::class ]; // ... 'aliases' => [ // ..., 'Tawk' => Larbrary\Tawk\Facades\Tawk::class ];
Config
In the .env
file, set the Property ID. For example, if the Direct Chat Link is https://embed.tawk.to/XXXXXXX/default
, the .env
file should contain the following:
TAWK_TO_PROPERTY_ID=XXXXXXX
If you're not using the default
chat widget, provide a Widget ID. For example, if the Direct Chat Link is https://embed.tawk.to/XXXXXXX/5bc4ae1275bef
, the .env
file should contain the following:
TAWK_TO_WIDGET_ID=5bc4ae1275bef
If you're using the TAWK_API_KEY
( only needed for automatically registering authenticated users with the tawk chat client ), the .env
file should contain the following:
TAWK_TO_API_KEY=your_tawk_api_key_goes_here
After making changes in the .env
file, you might need to clear the compiled views:
php artisan view:clear
Usage
Simply use @tawk
in your blade layout file just before the body closing tag ( </body>
):
<html> <head> <!-- ... --> </head> <body> <!-- ... --> @tawk </body> </html>
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details.
License
This package is released under the MIT license. Please see the license file for more information.