This repository demonstrates how to integrate TalkJS chat into a Laravel application, enabling real-time communication between users. See our How to add chat to a Laravel app with TalkJS tutorial for more details.
Before getting started, make sure you have the following ready or installed:
- Composer: Required for installing Laravel dependencies. Install Composer
- Laravel: If not, install it with Composer:
composer create-project --prefer-dist laravel/laravel your-project-name cd your-project-name
- Node.js and NPM: Required for Laravel Mix. Install Node.js and NPM
- TalkJS account: Sign up for a TalkJS account at https://talkjs.com/ to obtain your App ID.
- Use APP_ID: Replace the placeholder
<APP_ID>
inresources/views/chat.blade.php
with your App ID.
- Clone or download this project.
- Install dependencies:
composer install
npm install
- Set up your environment:
- Copy the
.env.example
file to.env
and configure your database. - Run migrations:
php artisan migrate
- Compile assets:
npm run dev
- Serve the application:
php artisan serve
- Open your browser and visit http://127.0.0.1:8000. You should see the Laravel welcome page.
- Follow the steps outlined in the tutorial to integrate TalkJS chat into your Laravel application.