Showing content from https://github.com/ably-labs/laravel-broadcast-app below:
ably-labs/laravel-broadcast-app: An example application using the official Ably Laravel Broadcaster
Chat app using Ably Broadcaster+Echo
Demo web-chat app using Ably Broadcaster+Echo based on laravel.
- Public chat rooms for a guest user.
- Laravel built-in user authentication (registration + login).
- Private chat rooms with presence for authenticated users.
- Typing indicator for private rooms.
- Join multiple rooms simultaneously.
- PHP version >= 7.3.
- Node.js >= 14.x.x.
Note - To quickly run the app without installing dependencies explicitly, check Run Using Docker.
- Clone the repository.
git clone https://github.com/ably-labs/laravel-broadcast-app
- Create the
.env
file in the project root. Copy contents from .env.example
into .env
.
- Set ABLY_KEY in .env file .
ABLY_KEY=ROOT_API_KEY_COPIED_FROM_ABLY_WEB_DASHBOARD
- Install dependencies.
composer install
npm install
- Generate application encryption key.
- Create simple sqlite db file.
touch database/database.sqlite // On linux
New-Item database\\database.sqlite -type file // On windows poweshell
- Run all of db migrations.
- Start laravel backend server.
- Start UI server in watch/hot-reloading mode.
- Access the web app via http://127.0.0.1:8000.
- Clone the repo. and set ABLY_KEY as mentioned in step 2 and 3 of SETUP.
- Start the app/docker-services using following command.
- Access the web app via http://127.0.0.1:8000.
- To stop the app/docker-services, run following command in a new terminal.
The web app works in two modes -
1. Guest Mode ( Only public rooms can be created / joined)
- Use room name in any format.
- In public rooms, messages are published via laravel server to ably (client can't publish messages directly through echo).
2. User Mode ( Private rooms can be created / joined)
- If user signed up and logged in into the Laravel app, it can create/join a private room.
- The required room prefix is
room-<id>
, as defined in routes/rooms.php
.
- In private rooms, messages are published through Laravel Echo from client-side.
Public room
Private room
User registration
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4