mahmoudkon / messenger
messenger chat
Installs: 141
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
Language:JavaScript
Requires
- php: ^8.0
- laravel/framework: ^9.0
- pusher/pusher-php-server: ^7.0
This package is auto-updated.
Last update: 2025-01-01 17:30:43 UTC
README
Requirements
- This messenger package requires PHP ^8.0 and laravel ^9.0, another version (7.0) for PHP < 8.0.
- Install pusher server
composer require pusher/pusher-php-server
- set pusher configuration in your env file.
PUSHER_APP_ID=######### PUSHER_APP_KEY=######### PUSHER_APP_SECRET=#########
- Install laravel echo from laravel documentation .
npm install --save-dev laravel-echo pusher-js
- Make enable for client events from your pusher setting.
Installation
You can install this package via composer using:
composer require mahmoudkon/messenger
For php < 8
composer require mahmoudkon/messenger:7.0
1- Use this trait in your User.php
model
... use Illuminate\Foundation\Auth\User as Authenticatable; use Messenger\Chat\Traits\Messageable; class User extends Authenticatable { use Messageable; }
2- make publish for views and assets files
php artisan vendor:publish --tag=messenger
can make publish for each file using
php artisan vendor:publish --tag=messenger-config php artisan vendor:publish --tag=messenger-migrations php artisan vendor:publish --tag=messenger-assets php artisan vendor:publish --tag=messenger-views
3- run migrations:
php artisan migrate
4- include app.js
file in the messanger/index.blade.php:
for mix
<script type="text/javascript" src="{{ asset('js/app.js') }}"></script>
for vite
@vite(['resources/js/app.js'])
Note
please check configuration file if you have problem with display image
Features
1- Welcome page to list users and conversations
2- profile for each user
3- search in users
4- send Media or attachment and download
5- Typing event
6- scrolling will start at the first unread message with the count of unread messages displayed.
7- read icons
-
when send message to user and he is offline, the icon will be one check icon.
-
when back to online the icon will be double ckeck.
-
When the message is read, the color of the icon will change to green color.