A demo application to learn soketi with laravel broadcast.
git clone https://github.com/rahulkhimsuriya/laravel-soketi-chat-app.git
cd laravel-soketi-chat-app
Install PHP dependencies:
composer install
Install node dependencies and build assets:
npm install && npm run build
Setup configuration:
cp .env.example .env
Generate application key:
php artisan key:generate
Create an SQLite database. You can also use another database (MySQL, Postgres), simply update your configuration accordingly. Read more
touch database/database.sqlite
Change database connection
DB_CONNECTION=sqlite
Run database migrations and seed database:
php artisan migrate --seed
Change broadcast driver in your .env
file :
BROADCAST_DRIVER=pusher
Setup soketi configuration in you .env
file:
Note: if you're using pusher insted of soketi please change credentials accordingly.
PUSHER_APP_ID=app-id
PUSHER_APP_KEY=app-key
PUSHER_APP_SECRET=app-secret
PUSHER_HOST=127.0.0.1
PUSHER_PORT=6001
PUSHER_SCHEME=http
PUSHER_APP_CLUSTER=mt1
Run soketi server (if you already have soketi server running then please skip this step)
npm run soketi
Login credentials:
Email: john@example.com
Password: password
Run the dev server (click me):
php artisan serve