dev-master
9999999-devLaravel Chat
MIT
The Requires
by Francisco Sepulveda
Laravel Chat
Deprecated, (*1)
Laravel Chat is a package to make on your own app a chat with multi users and private conversations., (*2)
This package use redis and socket.io to better performance., (*3)
Install redis on your server., (*4)
nmp install socket.io nmp install ioredis
Download laravel chat package to your project, (*5)
composer require "socieboy/chat" "dev-master"
Then execute the command, (*6)
Composer update
Place the service provider on your app.php config file., (*7)
Socieboy\Chat\ChatServiceProvider::class,
Now execute the command., (*8)
php artisan chat:tables
Then run, (*9)
php artisan migrate
Update the AuthenticatesAndRegistersUsers trait of the laravel auth controller. This trait is updated to fire events when a new user has been logged in and out., (*10)
Socieboy\Chat\Traits\AuthenticatesAndRegistersUsers
Publish the scripts and styles with the command, (*11)
php artisan vendor:publish
Set up on your master view page the fallow code. On the meta tags area between the <head></head> tags., (*12)
<meta name="token" id="token" value="{{ csrf_token() }}">
Also you have to add the style scripts., (*13)
<link rel="stylesheet" href="{{ url('css/chat.css') }}"/>
Same thing with the JS files required, make sure to place them in end before to close the <body><\body> tag., (*14)
<script src="{{ asset('js/socket.io.js') }}"></script> <script src="{{ url('js/chat.js') }}"></script>
Run redis on your server, (*15)
redis-server
Then on your project folder execute this code, (*16)
node socket.js
Laravel Chat
MIT