sajibmitra / chatdemo by sajibmitra

Laravel Chatdemo Project
3
0
1
Package Data
Maintainer Username: sajibmitra
Package Create Date: 2017-08-26
Package Last Update: 2017-09-02
Home Page: https://github.com/sajibmitra/chatdemo
Language: PHP
License: MIT
Last Refreshed: 2019-04-04 15:37:55
Package Statistics
Total Downloads: 3
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

Chatdemo

Chatdemo is a simple chatting example was developed in Laravel Framework 5.4 by using Pusher API and Laravel-Echo Broadcasting service.

Installation

Open Terminal (go to chatdemo directory) and run following command:

$ composer install

Rename .env.example file to .env and create homestead database grant all privileges to homestead user identified by password secret

DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

Run following command to create unique APP_KEY

$ pa key:generate

Set Broadcast driver as pusher and Add following PUSHER_APP info by creating new account in Pusher site (https://pusher.com/)

BROADCAST_DRIVER=pusher
PUSHER_APP_ID=xxxxxx
PUSHER_APP_KEY=xxxxxxxxxxxxxxxxxxxx
PUSHER_APP_SECRET=xxxxxxxxxxxxxxxxxxxx

Update pusher key, cluster and encrypted in bootstrap.js file as given below:

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: 'xxxxxxxxxxxxxxxxxxxx',
    cluster: 'xxx', //check on your pusher account-> 'your app' -> 'App Keys'
    encrypted: xxxxx, //If you are using 'http:' or  'https:'
});

Update cluster and encrypted value same as above in broadcasting.php:

pusher' => [
   	   'driver' => 'pusher',
   	   'key' => env('PUSHER_APP_KEY'),
   	   'secret' => env('PUSHER_APP_SECRET'),
   	   'app_id' => env('PUSHER_APP_ID'),
   	   'options' => [
   			'cluster' => 'xxx',
   			'encrypted' => xxx,
   	   	],
  	]

Run Following Command to download and build the required scripts dependencies

$ npm install 
$ npm run dev

Run server and Enjoy Chatting :smiley:

$ pa serve