All Projects → PHPJunior → Laravel Video Chat

PHPJunior / Laravel Video Chat

Licence: mit
Laravel Video Chat using Socket.IO and WebRTC

Projects that are alternatives of or similar to Laravel Video Chat

Laravel 5 Messenger
A Simple Laravel 5, 6, 7 & 8 Messenger with Pusher Capabilities
Stars: ✭ 75 (-88.39%)
Mutual labels:  laravel, laravel-5-package, chat
Lada Cache
A Redis based, fully automated and scalable database cache layer for Laravel
Stars: ✭ 424 (-34.37%)
Mutual labels:  laravel, laravel-5-package
Laravel Server Monitor
Server Monitoring Command for Laravel Applications
Stars: ✭ 424 (-34.37%)
Mutual labels:  laravel, laravel-5-package
Social Network
Mini social network that I made as my first web app project.
Stars: ✭ 458 (-29.1%)
Mutual labels:  realtime, socket-io
Applozic Android Sdk
Android Real Time Chat & Messaging SDK
Stars: ✭ 611 (-5.42%)
Mutual labels:  chat, realtime
Laravel Swoole
High performance HTTP server based on Swoole. Speed up your Laravel or Lumen applications.
Stars: ✭ 3,726 (+476.78%)
Mutual labels:  laravel, socket-io
Laravel Js Localization
🌐 Convert your Laravel messages and consume them in the front-end!
Stars: ✭ 451 (-30.19%)
Mutual labels:  laravel, laravel-5-package
Mercurius
Real-time Messenger for Laravel
Stars: ✭ 309 (-52.17%)
Mutual labels:  laravel, chat
Column Sortable
Package for handling column sorting in Laravel 5/6/7/8
Stars: ✭ 496 (-23.22%)
Mutual labels:  laravel, laravel-5-package
Vue Socket.io Extended
✌️⚡️ Socket.io bindings for Vue.js and Vuex (inspired by Vue-Socket.io)
Stars: ✭ 506 (-21.67%)
Mutual labels:  realtime, socket-io
Sudo Su
Laravel package to easily login as other users during development.
Stars: ✭ 554 (-14.24%)
Mutual labels:  laravel, laravel-5-package
Generator
Laravel 5.3+ Scaffold Generator, Support both bootstrap and Semantic UI
Stars: ✭ 327 (-49.38%)
Mutual labels:  laravel, laravel-5-package
Jwt Auth Guard
JWT Auth Guard for Laravel and Lumen Frameworks.
Stars: ✭ 319 (-50.62%)
Mutual labels:  laravel, laravel-5-package
Laravel Translation
Translation management for your Laravel application.
Stars: ✭ 350 (-45.82%)
Mutual labels:  laravel, laravel-5-package
Laravel Log Enhancer
Make debugging easier by adding more data to your laravel logs (Laravel 5.6+)
Stars: ✭ 311 (-51.86%)
Mutual labels:  laravel, laravel-5-package
Telegram
✈️ Telegram Notifications Channel for Laravel
Stars: ✭ 450 (-30.34%)
Mutual labels:  laravel, laravel-5-package
Laravel Mysql Spatial
MySQL Spatial Data Extension integration with Laravel.
Stars: ✭ 578 (-10.53%)
Mutual labels:  laravel, laravel-5-package
Administrator
a fork from Frozennode/Administrator
Stars: ✭ 296 (-54.18%)
Mutual labels:  laravel, laravel-5-package
Mailgun
Mailgun package for Laravel
Stars: ✭ 297 (-54.02%)
Mutual labels:  laravel, laravel-5-package
Laravel Scout Mysql Driver
Laravel Scout MySQL Driver
Stars: ✭ 491 (-23.99%)
Mutual labels:  laravel, laravel-5-package

Laravel Video Chat

Laravel Video Chat using Socket.IO and WebRTC

Build Status StyleCI Latest Stable Version Total Downloads

Installation

composer require php-junior/laravel-video-chat

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

PhpJunior\LaravelVideoChat\LaravelVideoChatServiceProvider::class,
php artisan vendor:publish --provider="PhpJunior\LaravelVideoChat\LaravelVideoChatServiceProvider"

And

php artisan migrate
php artisan storage:link

change APP_URL in .env

This is the contents of the published config file:

return [
    'relation'  => [
        'conversations' =>  PhpJunior\LaravelVideoChat\Models\Conversation\Conversation::class,
        'group_conversations' => PhpJunior\LaravelVideoChat\Models\Group\Conversation\GroupConversation::class
    ],
    'user' => [
        'model' =>  App\User::class,
        'table' =>  'users' // Existing user table name
    ],
    'table' => [
        'conversations_table'   =>  'conversations',
        'messages_table'        =>  'messages',
        'group_conversations_table' =>  'group_conversations',
        'group_users_table'     =>  'group_users',
        'files_table'           =>  'files'
    ],
    'channel'   =>  [
        'new_conversation_created'  =>  'new-conversation-created',
        'chat_room'                 =>  'chat-room',
        'group_chat_room'           =>  'group-chat-room'
    ],
    'upload' => [
        'storage' => 'public'
    ]
];

Uncomment App\Providers\BroadcastServiceProvider in the providers array of your config/app.php configuration file

Install the JavaScript dependencies:

    npm install
    npm install --save laravel-echo js-cookie vue-timeago socket.io socket.io-client webrtc-adapter vue-chat-scroll

If you are running the Socket.IO server on the same domain as your web application, you may access the client library like

<script src="//{{ Request::getHost() }}:6001/socket.io/socket.io.js"></script>

in your application's head HTML element

Next, you will need to instantiate Echo with the socket.io connector and a host.

 require('webrtc-adapter');
 window.Cookies = require('js-cookie');
 
 import Echo from "laravel-echo"
 
 window.io = require('socket.io-client');
 
 window.Echo = new Echo({
     broadcaster: 'socket.io',
     host: window.location.hostname + ':6001'
 });

Finally, you will need to run a compatible Socket.IO server. Use tlaverdure/laravel-echo-server GitHub repository.

In resources/assets/js/app.js file:

 import VueChatScroll from 'vue-chat-scroll';
 import VueTimeago from 'vue-timeago';
 
 Vue.use(VueChatScroll);
 Vue.component('chat-room' , require('./components/laravel-video-chat/ChatRoom.vue'));
 Vue.component('group-chat-room', require('./components/laravel-video-chat/GroupChatRoom.vue'));
 Vue.component('video-section' , require('./components/laravel-video-chat/VideoSection.vue'));
 Vue.component('file-preview' , require('./components/laravel-video-chat/FilePreview.vue'));
 
 Vue.use(VueTimeago, {
     name: 'timeago', // component name, `timeago` by default
     locale: 'en-US',
     locales: {
         'en-US': require('vue-timeago/locales/en-US.json')
     }
 })

Run npm run dev to recompile your assets.

Features

  • One To One Chat ( With Video Call )
  • Accept Message Request
  • Group Chat
  • File Sharing

Usage

Get All Conversation and Group Conversation

$groups = Chat::getAllGroupConversations();
$conversations = Chat::getAllConversations()
<ul class="list-group">
    @foreach($conversations as $conversation)
        <li class="list-group-item">
        @if($conversation->message->conversation->is_accepted)
            <a >
                <h2>{{$conversation->user->name}}</h2>
                @if(!is_null($conversation->message))
                    <span>{{ substr($conversation->message->text, 0, 20)}}</span>
                @endif
            </a>
         @else
            <a >
                <h2>{{$conversation->user->name}}</h2>
                @if($conversation->message->conversation->second_user_id == auth()->user()->id)
                    <a href="accept_request_route" class="btn btn-xs btn-success">
                        Accept Message Request
                    </a>
                @endif
            </a>
         @endif
        </li>
    @endforeach

    @foreach($groups as $group)
        <li class="list-group-item">
            <a >
                <h2>{{$group->name}}</h2>
                <span>{{ $group->users_count }} Member</span>
            </a>
        </li>
    @endforeach
</ul>

Start Conversation

Chat::startConversationWith($otherUserId);

Accept Conversation

Chat::acceptMessageRequest($conversationId);

Get Conversation Messages

$conversation = Chat::getConversationMessageById($conversationId);
<chat-room :conversation="{{ $conversation }}" :current-user="{{ auth()->user() }}"></chat-room>

Send Message

You can change message send route in component

Chat::sendConversationMessage($conversationId, $message);

Start Video Call ( Not Avaliable On Group Chat )

You can change video call route . I defined video call route trigger/{id} method POST Use $request->all() for video call.

Chat::startVideoCall($conversationId , $request->all());

Start Group Conversation

Chat::createGroupConversation( $groupName , [ $otherUserId , $otherUserId2 ]);

Get Group Conversation Messages

$conversation = Chat::getGroupConversationMessageById($groupConversationId);
<group-chat-room :conversation="{{ $conversation }}" :current-user="{{ auth()->user() }}"></group-chat-room>

Send Group Chat Message

You can change message send route in component

Chat::sendGroupConversationMessage($groupConversationId, $message);

Add Members to Group

Chat::addMembersToExistingGroupConversation($groupConversationId, [ $otherUserId , $otherUserId2 ])

Remove Members from Group

Chat::removeMembersFromGroupConversation($groupConversationId, [ $otherUserId , $otherUserId2 ])

Leave From Group

Chat::leaveFromGroupConversation($groupConversationId);

File Sharing

Run this command php artisan storage:link

Send Files in Conversation

Chat::sendFilesInConversation($conversationId , $request->file('files'));

Send Files in Group Conversation

Chat::sendFilesInGroupConversation($groupConversationId , $request->file('files'));

ToDo

  • Add Members to Group
  • Remove Member From Group

Next Version

  • Group Video Call

Credits

  • All Contributors

License

The MIT License (MIT). Please see License File for more information.

Demo Project

Support on Beerpay

Hey dude! Help me out for a couple of 🍻!

Beerpay Beerpay

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].