mahmoudkon/messenger

messenger chat

Installs: 133

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 1

Open Issues: 0

Language:JavaScript

v8 2022-12-12 10:46 UTC

This package is auto-updated.

Last update: 2024-05-15 13:39:17 UTC


README

Laravel Messenger

Laravel Messenger

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=#########
    npm install --save-dev laravel-echo pusher-js
  • Make enable for client events from your pusher setting.

enable-client-events.PNG

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

wlecome page

2- profile for each user

user profile

3- search in users

search

4- send Media or attachment and download

send media

5- Typing event

typing

6- scrolling will start at the first unread message with the count of unread messages displayed.

new-messagescount

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.

not-receive-message