Installation
Wirechat is a simple yet robust chat package built with the TALL Stack, making it easy to integrate into your Laravel app with just a few commands.
#Prerequisites
Before you begin, ensure the following are installed:
- PHP version 8.2 or later
- Laravel version 10 or later
- Livewire version 3.2.3 or later
- Tailwindcss 4.x+
#Installing
#1. Require composer package
Before installing Wirechat, make sure authentication is already set up in your application. Any standard Laravel authentication flow is fine.
Install the package with Composer:
composer require wirechat/wirechat
#2.Install Wirechat:
Run this command to install and publish the necessary files:
php artisan wirechat:install
The following actions will be executed:
- Publish configuration file
- Publish migration files
- Create a default panel
- Create a storage symlink
The wirechat:install command also creates a default panel at app/Providers/Wirechat/ChatsPanelProvider.php, so you can move straight into panel configuration after installation.
#3. Run Migrations:
Enable UUIDs before running migrations (Optional)
If you want Wirechat to use UUIDs instead of auto-incrementing integers for conversations, update the config before running migrations:
// config/wirechat.php
'uses_uuid_for_conversations' => true,
🔶 Important: This setting should only be configured during initial setup and before running any migrations. Once the tables are created, switching between UUIDs and integers is not supported and may break existing data.
Finally Apply the necessary database migrations with:
php artisan migrate
#Setup Tailwind CSS
Wirechat requires Tailwind CSS v4.0 or later.
If Tailwind is already installed in your project, add the following import to resources/css/app.css:
/* resources/css/app.css */
@import '../../vendor/wirechat/wirechat/resources/css/app.css';
#WebSockets and Queue Setup
Wirechat uses WebSockets to broadcast messages in real-time to conversations and their participants.
Step 1: Enable Broadcasting
In newer Laravel installations, broadcasting is disabled by default. To enable it, run:
php artisan install:broadcasting
Note: This command will prompt you to install Laravel Reverb and necessary front-end packages such as Echo. Accept if you don’t yet have a WebSocket server set up.
Then, start your Reverb server:
php artisan reverb:start
For more details, refer to the Laravel Broadcasting Documentation, including information on integrating Laravel Echo for real-time updates.
Step 2: Start Your Queue Worker
After configuring broadcasting, start a queue worker to handle message broadcasting and other queued tasks:
php artisan queue:listen --queue=messages,default
Queue Prioritization
Wirechat uses two queues for efficient delivery:
- High Priority
messages: For real-time broadcasting of messages to users in a conversation. - Default Priority
default: For notifications like updating chat lists or showing unread message counts.
To customize these queue names, configure them in your panel:
use Wirechat\Wirechat\Panel;
public function panel(Panel $panel): Panel
{
return $panel
//...
->messagesQueue('messages')
->eventsQueue('default');
}
Step 3: Start Your Development Server
To start your development server, run:
composer run dev
If your application does not use Laravel's composer run dev workflow, run your PHP server and frontend build separately instead:
php artisan serve
npm run dev
For more details, see Laravel's Tailwind and Composer Dev Command Documentation.
#Publishing Translations
If you need to customize the language files, you can publish them using the following command:
php artisan vendor:publish --tag=wirechat-translations
#Publishing Views
To modify Wirechat's Blade views, publish them with this command:
php artisan vendor:publish --tag=wirechat-views