PHPackages                             tealorca/laravel-freshchat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tealorca/laravel-freshchat

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tealorca/laravel-freshchat
==========================

Freshchat Web Widget for Laravel

v0.0.2(5y ago)177[1 issues](https://github.com/tealorca/laravel-freshchat/issues)MITPHPPHP ^7.1

Since Mar 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/tealorca/laravel-freshchat)[ Packagist](https://packagist.org/packages/tealorca/laravel-freshchat)[ Docs](https://github.com/tealorca/laravel-freshchat)[ RSS](/packages/tealorca-laravel-freshchat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Freshchat Web Widget for Laravel
================================

[](#freshchat-web-widget-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fa257ee6abbc48d599b1fd005f56a8f6ba1334c1c398bc186382c2f6d9e34f2f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7465616c6f7263612f6c61726176656c2d6672657368636861742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tealorca/laravel-freshchat)[![Total Downloads](https://camo.githubusercontent.com/cd9a71cfb87fbf9ca8cc14bd3fac54cc823fb77cd9035c67bd9995e7c3f675f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7465616c6f7263612f6c61726176656c2d6672657368636861742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tealorca/laravel-freshchat)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tealorca/laravel-freshchat
```

The package will automatically register a service provider.

Next, Include the chat widget into blade layout code by adding Blade directive `@laravelFreshchat` before the end of the body tag.

```

    ...
    ...
    @laravelFreshchat

```

Next, you need to publish the freshchat configuration file:

```
php artisan vendor:publish --provider="TealOrca\LaravelFreshchat\LaravelFreshchatServiceProvider" --tag="config"
```

This is the default content of the config file that will be published as `config/laravel-freshchat.php`:

```
/*
 * Freshchat Configurations
 */
return [

    /*
     * Freshchat's Web Messenger Token.
     *
     * You can see that on Web Messenger Settings page of Freshchat Portal.
     */
    'token'      => env('FRESHCHAT_TOKEN', null),

    /*
     * Freshchat's Web Messenger Host Value. ( it would be different based on your data region)
     *
     * Few examples:
     *
     *	https://wchat.freshchat.com
     *	https://wchat.in.freshchat.com
     *
     * You can see that on Web Messenger Settings page of Freshchat Portal.
     */
    'host'       => env('FRESHCHAT_HOST', 'https://wchat.freshchat.com'),
];
```

Once you added `FRESHCHAT_TOKEN` and `FRESHCHAT_HOST` values to your `.env` file you can see the widget on your webpage.

The displayed widget will be treated as a [Anonymous User](https://developers.freshchat.com/web-sdk/#anonymous-user) window.

You can see the [Freshchat's Web SDK Docs](https://developers.freshchat.com/web-sdk/) for more details.

Configure Logged in User
------------------------

[](#configure-logged-in-user)

#### Add the `ChatUser` Trait to your User Model

[](#add-the-chatuser-trait-to-your-user-model)

To treat the current authenticated user as a Freshchat user, simply add the `TealOrca\LaravelFreshchat\Traits\ChatUser` trait to the user authentication model.

```
use TealOrca\LaravelFreshchat\Traits\ChatUser;

class User extends Model {

    use ChatUser;

	/**
     * Specify the column name for Freshchat Restore Id
     */
    protected $freshchatRestoreId = '';

    /**
     * Specify the value for Freshchat External Id
     *
     * @return string
     */
    public function chatUserExternalId()
    {
        return $this->email; // using the user's email as the external id
    }

    /**
     * Specify the properties
     *
     * @return array
     */
    public function chatUserProperties() {

        return [
            'firstName' => 'first_name', ////// '>' => '>',
            'lastName' => 'last_name',
            'email' => 'email',
            'phone' => 'phone_no',
            'phoneCountryCode' => 'phone_country_code',
        ];
    }
}
```

#### Add the Restore Id column to your user table

[](#add-the-restore-id-column-to-your-user-table)

```
php artisan make:migration add_freshchat_restore_id_to_users_table --table=users
```

```
class AddFreshchatRestoreIdToUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {

            if (!Schema::hasColumn('users', 'freshchat_restore_id')) {
                Schema::table('users', function (Blueprint $table) {
                    $table->string('freshchat_restore_id')->nullable();
                });
            }

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {

            if (Schema::hasColumn('users', 'freshchat_restore_id')) {
                $table->dropColumn('freshchat_restore_id');
            }
        });
    }
}
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Daniel Felix](https://github.com/itsdanielfelix)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1879d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/795028?v=4)[Daniel](/maintainers/danielfelix)[@DanielFelix](https://github.com/DanielFelix)

---

Top Contributors

[![itsdanielfelix](https://avatars.githubusercontent.com/u/28915352?v=4)](https://github.com/itsdanielfelix "itsdanielfelix (7 commits)")

---

Tags

tealorcalaravel-freshchat

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tealorca-laravel-freshchat/health.svg)

```
[![Health](https://phpackages.com/badges/tealorca-laravel-freshchat/health.svg)](https://phpackages.com/packages/tealorca-laravel-freshchat)
```

###  Alternatives

[sskaje/mqtt

sskaje's MQTT Class

8769.5k1](/packages/sskaje-mqtt)[birgir/geo-query

Modify the WP\_Query to support the geo\_query parameter. Uses the Haversine SQL optimization by Ollie Jones.

683.0k](/packages/birgir-geo-query)[breadlesscode/neos-blog

Ready to use blog package

161.4k](/packages/breadlesscode-neos-blog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
