tawk.to has a lot of integrations, but not for Laravel. This is a tawk.to chat widget for Laravel.
composer require emotality/tawk-laravel
php artisan vendor:publish --provider="Emotality\TawkTo\TawkToServiceProvider"
- Add the following line to your
.env
file:
TAWKTO_KEY="<your_property_id>"
Get your key from the Property ID field from your dashboard
Laravel 5.5+ will use the auto-discovery function but for Laravel 5.4 and lower, you will need to include the service provider & facade manually in config/app.php
:
'providers' => [
...,
/*
* Package Service Providers...
*/
Emotality\TawkTo\TawkToServiceProvider::class,
...,
];
...
'aliases' => [
...,
'TawkTo' => Emotality\TawkTo\TawkTo::class,
];
Just echo the widget code in your app layout blade inside the body tag:
...
{{ TawkTo::widgetCode() }}
</body>
</html>
Or, if you don't want to use a config file, you can set your key directly like this:
...
{{ TawkTo::widgetCode('your_property_id') }}
</body>
</html>
tawk-laravel is released under the MIT license. See LICENSE for details.