larbrary/tawk

Website chat widget (tawk.to integration for Laravel).

Installs: 43

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:laravel-package

v1.0.4 2020-10-28 05:41 UTC

This package is auto-updated.

Last update: 2024-04-30 00:39:24 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.