The missing integration of tawk.to chat widget for Laravel.
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
];
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
Simply use @tawk
in your blade layout file just before the body closing tag ( </body>
):
<html>
<head>
<!-- ... -->
</head>
<body>
<!-- ... -->
@tawk
</body>
</html>
Please see the changelog for more information on what has changed recently.
$ composer test
Please see contributing.md for details.
This package is released under the MIT license. Please see the license file for more information.