/tawk-laravel

A tawk.to chat widget for Laravel.

Primary LanguagePHPMIT LicenseMIT

tawk.to for Laravel

tawk.to has dozens of integrations, but not for Laravel. This is a tawk.to chat widget for Laravel.

tawk-laravel

Usage

Just echo the widget code in your app layout blade inside the body tag:

        ...
        {{ TawkTo::widgetCode() }}
    </body>
</html>

Installation

Install from command line:

composer require emotality/tawk-laravel

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' => [
    ...,
    Emotality\TawkTo\TawkToServiceProvider::class,
];

...

'aliases' => [
    ...,
    'TawkTo' => Emotality\TawkTo\Facades\TawkTo::class,
];

Config

Copy the default config file:

php artisan vendor:publish --provider="Emotality\TawkTo\TawkToServiceProvider"

Open .env and set your API key:

TAWKTO_API_KEY=54f52bfdf7bcaa72719c6b7

Get your API key from the Direct Chat Link text field from the dashboard following these steps.

License

tawk-laravel is released under the MIT license. See LICENSE for details.