Pre-build Laravel chat package. You can use this package to create a chat/messaging Laravel application or you can use the pre-build front-end part to kick-start your project.
Pre-build Laravel chat package. You can use this package to create a chat/messaging Laravel application or you can use the pre-build front-end part to kick-start your project.
Via Composer
composer require sunarctech/laravel-chat
then
php artisan chat:install
Install this package and add authentication gurad, you can use some package like Laravel UI
This package uses WebSockets and for that dependent on beyondcode/laravel-websockets
php artisan vendor:publish --provider="BeyondCode\LaravelWebSockets\WebSocketsServiceProvider" --tag="config" --tag="migrations"
chat.php
return [
'image_validation' => "max:1024|mimes:png,jpeg",
'video_validation' => "max:102400|mimes:mp4",
'file_validation' => "max:1024|mimes:txt",
];
websockets.php
'enable_client_messages' => 'true',
broadcasting.php
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
'host' => '127.0.0.1',
'port' => 6001,
'scheme' => 'http',
],
],
Uncomment this provider from app.php, If not present please add this.
/*
* Application Service Providers...
*/
...
App\Providers\BroadcastServiceProvider::class,
...
.env
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=myappid
PUSHER_APP_KEY=myappkey
PUSHER_APP_SECRET=myappsecret
Package ships with some migration files, which is required in order to save the messages, defaul driver is used MySQL.
php artisan migrate
php artisan storage:link
In order to use the chat, Fisrt need to start the websocket server Using Command:
php artisan websocket:serve
Visit the route, registered with Package.
www.yourdomain.com/chat
You might face dependency version mismatch issue at the time of installation, To fix the issue just add -W:
composer require sunarctech/laravel-chat -W
We are the leading Software Development Company providing end-to-end IT services & solutions to our esteemed customers in multiple industries and domains for the past 18+ years? Give us a call.
https://sunarctechnologies.com/
info@sunarctechnologies.com
+91-8764025209
Versions supported.
Version | Laravel Version | PHP Version | Support |
---|---|---|---|
0.1 | <=7.0 | 7.3 - 8.x | All features |
The MIT Public License. Please see LICENSE for more information.