A simple demo application showcasing the musonza/chat Laravel package. This application demonstrates how to build a real-time chat system using Laravel, Vue.js, Inertia.js, and Laravel Reverb.
- 💬 Real-time messaging with Laravel Reverb
- 👥 User-to-user conversations
- 🤖 Bot conversations
- 🔐 Authentication with Laravel Breeze
- 📱 Responsive Vue.js frontend with Inertia.js
- 🔒 Message encryption support
- ✨ Modern UI with Tailwind CSS
- PHP >= 8.2
- Composer
- Node.js >= 18.x and npm
- SQLite (or MySQL/PostgreSQL)
-
Clone the repository
git clone <repository-url> cd chat-demo
-
Install PHP dependencies
composer install
-
Install JavaScript dependencies
npm install
-
Set up environment file
cp .env.example .env php artisan key:generate
-
Configure your database
Edit
.envand set your database configuration. For SQLite (default):DB_CONNECTION=sqlite DB_DATABASE=/absolute/path/to/database/database.sqlite
-
Run migrations
php artisan migrate
-
Build frontend assets
npm run build
Or for development:
npm run dev
-
Start the development server
php artisan serve
For full development setup (server, queue, logs, and Vite):
composer run dev
Make sure to configure Laravel Reverb in your .env file:
REVERB_APP_ID=your-app-id
REVERB_APP_KEY=your-app-key
REVERB_APP_SECRET=your-app-secret
REVERB_HOST=localhost
REVERB_PORT=8080
REVERB_SCHEME=httpStart the Reverb server:
php artisan reverb:startThe application uses Laravel's broadcasting system. Make sure your .env has:
BROADCAST_DRIVER=reverb- Register a new account or login with existing credentials
- Start a conversation by clicking "New Conversation" and selecting a user
- Chat with bots by navigating to the Discover page
- Send messages in real-time - messages appear instantly for all participants
- Backend: Laravel 12
- Frontend: Vue.js 3 + Inertia.js
- Real-time: Laravel Reverb
- Styling: Tailwind CSS
- Chat Package: musonza/chat
chat-demo/
├── app/
│ ├── Http/Controllers/
│ │ ├── Api/ # API endpoints for conversations and messages
│ │ └── ChatController.php
│ └── Models/
│ └── Bot.php # Bot model for chat bots
├── resources/
│ └── js/
│ ├── Components/Chat/ # Vue chat components
│ ├── Pages/Chat/ # Chat pages
│ └── Composables/ # Vue composables for messages and real-time
└── database/
└── migrations/ # Database migrations including chat tables
php artisan testThis project uses Laravel Pint for code formatting:
./vendor/bin/pintThis is a demo application. If you'd like to contribute to the underlying chat package, please visit musonza/chat.
This demo application is open-sourced software licensed under the MIT license.
- musonza/chat - The Laravel chat package powering this demo