dev-master
9999999-devLaravel real-time chat application
The Requires
- laravel/framework ~5.4
- php >=7.0.0
Laravel real-time chat application
Laravchat is a real-time chat package that will enable logged in users in an application to start conersations with other users and chat in real-time for Laravel 5.4+, (*1)
To install the package just run, (*2)
composer create-project frutdev/laravchat
After this you'll have to have some things, follow these instructions:, (*3)
First of all you will need to run, (*4)
composer require pusher/pusher-php-server "~3.0" npm install npm install --save laravel-echo pusher-js
This package uses Carbon
package so make sure to run, if you don't have it already:, (*5)
composer require nesbot/carbon
Run, (*6)
php artisan make:auth
Run, (*7)
php artisan vendor:publish
And select Frutdev\Laravchat\LaravchatServiceProvider
, (*8)
After doing this add the following line to your the mix
in webpack.mix.js
, (*9)
.js('resources/assets/laravchatjs/laravchat.js', 'public/js')
Configure your .env
file with your Pusher Key and go to vendor/frutdev/laravchat/src/resources/js/bootstrap.js
and modify YOUR_APP_KEY
and YOUR_APP_CLUSTER
with the corresponding pusher key and cluster., (*10)
In config/broadcasting.php
add the following to the options
in pusher
, (*11)
'cluster' => 'us2', 'encrypted' => true,
Run, (*12)
npm run dev
If you are using Vue.js
in your aplication this might be a little tricky but I will look into how to merge my file with js/app.js
, (*13)
Within your resources/views/layouts/app.blade.php
, (*14)
Add on top, (*15)
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
And on the bottom remove, (*16)
<script src="{{ asset('js/app.js') }}"></script>
and add, (*17)
<script src="{{ asset('js/laravchat.js') }}"></script>
ALMOST THERE!, (*18)
Uncomment App\Providers\BroadcastServiceProvider::class
provider within config/app.php
Run, (*19)
php artisan migrate php artisan serve
Go to your localhost and enter /chat
, (*20)
V 1.0, (*21)
Laravel real-time chat application