Giter Site home page Giter Site logo

nahid / talk Goto Github PK

View Code? Open in Web Editor NEW
1.6K 70.0 324.0 290 KB

Talk is a real-time users messaging and chatting system for Laravel.

License: MIT License

PHP 94.38% Dockerfile 3.76% Blade 1.86%
realtime-message message-threads conversation talk laravel-message laravel-chat inbox laravel-talk laravel-package

talk's Introduction

Laravel-Talk

Awesome Laravel GitHub license Build Status MadeWithLaravel.com shield

Talk is a user conversation (chatting) system with realtime messaging for Laravel. You can easily integrate this package with any Laravel based project. It helps you to develop a messaging system in just few minutes. Here is a project screenshot that was developed by Talk.

Talk v2.1.0 supports realtime messaging. Learn more about Talk Live Messaging

Feedback

If you already used Talk, please share your experience with us. It will make the project better.

Give us your feedback

Built with Talk

If you are using Talk in your project please share your project URL or project name with us. It will inspire other people to use Talk.

See which project was Built with Talk.

Caution

Do not migrate 1.1.7 from its higher version directly. Please try our sample project first and then apply it on your project.

Talk-Example Screenshot

You may try Talk-Example project.

Or you can try live Demo by using this credentials:

username: admin   
password: admin

So let's start your tour :)

Features

  • Head to head messaging
  • Realtime messaging
  • Creating new conversation
  • Message threads with latest one
  • View conversations by user id or conversation id
  • Support pagination in threads and messages
  • Delete (soft delete) message from both end. Sender and receiver can delete their message from their end
  • Permanent delete message
  • Mark message as seen
  • Only participant can view or access there message or message threads
  • Inline url render using oembed specifications

Installation

Talk is a Laravel package so you can install it via Composer. Run this command in your terminal from your project directory:

composer require nahid/talk

Wait for a while, Composer will automatically install Talk in your project.

Configuration

When the download is complete, you have to call this package service in config/app.php config file. To do that, add this line in app.php in providers section:

Nahid\Talk\TalkServiceProvider::class,

To use facade you have to add this line in app.php in aliases array:

'Talk'      => Nahid\Talk\Facades\Talk::class,

Now run this command in your terminal to publish this package resources:

php artisan vendor:publish --provider="Nahid\Talk\TalkServiceProvider"

After running this command, all necessary file will be included in your project. This package has two default migrations. So you have to run migrate command like this. (But make sure your database configuration is configured correctly.)

php artisan migrate

Okay, now you need to configure your user model for Talk. Go to config/talk.php and config it:

return [
    'user' => [
        'model' => 'App\User',
        'foreignKey' => null,
        'ownerKey' => null,
    ],

    'broadcast' => [
        'enable' => true,
        'app_name' => 'talk-example',
        'driver' => env('TALK_BROADCAST_DRIVER', 'pusher'), // pusher or laravel-websockets
        'pusher' => [
            'app_id' => env('PUSHER_APP_ID', ''),
            'app_key' => env('PUSHER_APP_KEY', ''),
            'app_secret' => env('PUSHER_APP_SECRET', ''),
            'options' => [
                'cluster' => env('PUSHER_APP_CLUSTER', 'ap2'),
                'encrypted' => env('PUSHER_APP_ENCRYPTION', false),
                'host' => '127.0.0.1',
                'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
                'scheme' => 'http',
                'wsHost' => '127.0.0.1',
                'wsPort' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
                'forceTLS' => false,
                'disableStats' => true
            ]
        ],
    ],


    'oembed' => [
        'enabled' => false,
        'url' => '',
        'key' => ''
    ]
];

Usage

Its very easy to use. If you want to set authenticate user id globally then you have to set a middleware first. Go to app/Http/Kernel.php and set it in $routeMiddleware array:

'talk'  =>  \Nahid\Talk\Middleware\TalkMiddleware::class,

And now you can use it from anywhere with middleware. Suppose you have a Controller and you want to set authenticate user id globally then write this in controller constructor:

$this->middleware('talk');

But instead of set id globally you can use these procedure from any method in controller:

Talk::setAuthUserId(auth()->user()->id);

Now you may use any method what you need. But if want pass authentic id instantly, this method may help you:

Talk::user(auth()->user()->id)->anyMethodHere();

Please see the API Doc.

API List

setAuthUserId

setAuthUserId method sets the currently loggedin user id, which you pass through parameter. If you pass null or empty value then it returns false.

Syntax

void setAuthUserId($userid)

Example

Constructor of a Controller is the best place to write this method.

function __construct()
{
    Talk::setAuthUserId(auth()->user()->id);
}

When you pass logged in user ID, Talk will know who is currently authenticated for this system. So Talk retrieve all information based on this user.

user

You may use this method instead of setAuthUserId() method. When you have to instantly access users conversations then you may use it. Syntax

object user($id)

Example When you haven't set authenticated user id globally, then you just use this method directly with others method.

$inboxes = Talk::user(auth()->user()->id)->threads();
return view('messages.threads', compact('inboxes'));

isConversationExists

This method checks currently logged in user and if given user is already in conversation

Syntax

int|false isConversationExists($userid)

Example

if ($conversationId = Talk::isConversationExists($userId)) {
    Talk::sendMessage($conversationId, $message);
} 

isAuthenticUser

isAuthenticUser checks if the given user exists in given conversation.

Syntax

boolean isAuthenticUser($conversationId, $userId)

Example

if (Talk::isAuthenticUser($conversationId, $userId)) {
    Talk::sendMessage($conversationId, $message);
} 

sendMessage

You can send messages via conversation id by using this method. If the message is successfully sent, it will return objects of Message model otherwise, it will return false

Syntax

object|false sendMessage($conversationId, $message)

Example

    $message = Talk::sendMessage($conversationId, $message);
    if ($message) {
        return response()->json(['status'=>'success', 'data'=>$message], 200);
   }

sendMessageByUserId

You can send message via receiver id by using this method. If the message is successfully sent, it will return objects of Message model otherwise, it will return false

Syntax

object|false sendMessageByUserId($userId, $message)

getInbox

If you want to get all the inboxes except soft deleted message , this method may help you. This method gets all the inboxes via previously assigned authenticated user id. It returns collections of message thread with latest message.

Syntax

array getInbox([$order = 'desc'[,$offset = 0[, $take = 20]]])

Example

// controller method
$inboxes = Talk::getInbox();
return view('message.threads', compact('inboxes'));
<!-- messages/threads.blade.php -->
<ul>
    @foreach($inboxes as $inbox)
        <li>
            <h2>{{$inbox->withUser->name}}</h2>
            <p>{{$inbox->thread->message}}</p>
            <span>{{$inbox->thread->humans_time}}</span>
        </li>
    @endforeach
</ul>

getInboxAll

Its similar as getInbox() method. If you want to get all the inboxes with soft deleted messages, this method may help you. This method gets all the inboxes via given user id.

Syntax

object getInboxAll([$order = 'desc'[,$offset = 0[, $take = 20]]])

threads

This method is an alias of getInbox() method.

Syntax

array threads([$order = 'desc'[,$offset = 0[, $take = 20]]])

threadsAll

This method is an alias of getInboxAll() method.

Syntax

array threadsAll([$order = 'desc'[,$offset = 0[, $take = 20]]])

getConversationsById

When you want to get all the conversations using your desire conversation id, you can try this method. This method returns all the conversations (except soft deleted) with sender and withUser objects

Syntax

array getConversationsById($conversationId[, $offset = 0[, $take = 20]])

Example

// controller method
$conversations = Talk::getConversationsById($conversationId);
$messages = $conversations->messages;
$withUser = $conversations->withUser;

return view('messages.conversations', compact('messages', 'withUser'));

This method returns two objects messages and withUser. messages object contains messages collection and withUser object contains participant User collections.

Let's see how to use it with your views

<!-- messages/conversations.blade.php -->
<div class="message-container">
    <h2>Chat with {{$withUser->name}}</h2>
    @foreach ($messages as $msg)
     <div class="message">
        <h4>{{$msg->sender->name}}</h4>
        <span>{{$msg->humans_time}}</span>
        <p>
            {{$msg->message}}
       </p> 
    </div>
    @endforeach
</div>

getConversationsAllById

This method is similar as getConversationsById(). The only difference between this method is its return all messages with soft deleted items.

Syntax

array getConversationsAllById($conversationId[, $offset = 0[, $take = 20]])

getConversationsByUserId

When you want to get all the conversations using your desire receiver id, you can try this method. This method returns all the conversations (except soft deleted message) with user's objects

Syntax

object getConversationsByUserId($receiverId [, $offset = 0[, $take = 20]])

getConversationsAllByUserId

This method is similar as getConversationsByUserId(). The only difference between this method is it returns all messages with soft deleted items.

Syntax

array getConversationsAllByUserId($receiverId[, $offset = 0[, $take = 20]])

getMessages

This is a alias of getConversationsById() method.

Syntax

array messages($conversationId[, $offset = 0[, $take = 20]])

getMessagesAll

This is a alias of getConversationsAllById() method.

Syntax

array messagesAll($conversationId[, $offset = 0[, $take = 20]])

getMessagesByUserId

This is a alias of getConversationsByUserId() method.

Syntax

array messagesByUserId($receiverId[, $offset = 0[, $take = 20]])

getMessagesAllByUserId

This is a alias of getConversationsAllByUserId() method.

Syntax

array messagesAllByUserId($receiverId[, $offset = 0[, $take = 20]])

readMessage

If you want to read a single message then you may use it. This message is return a single message object by message id.

Syntax

array readMessage($messageId)

getReceiverInfo

This method returns all the information about message receiver.

This method is deprecated from version 2.0.0 and it will be removed from version 2.0.2

Syntax

object getReceiverInfo($conversationId)

makeSeen

If you want to set a message as seen you can use this method.

Syntax

boolean makeSeen($messageId)

deleteMessage

When you want to delete a specific message from a conversation, you have to use this method. This method soft delete message for both user-end individually.

Syntax

boolean deleteMessage($messageId)

deleteForever

If you want to hard delete or permanently delete a specific message then you have to use this method.

Syntax

boolean deleteForever($messageId)

deleteConversations

This method is used to permanently delete all conversations.

Syntax

boolean deleteConversations($conversationId)

Realtime Messaging

Talk also support realtime messaging thats called Talk-Live. Talk support pusher and laravel-websocket for realtime messaging. So first you have to configure pusher or laravel-websocket. Go to app/talk.php again and configure.

return [
    'user' => [
        'model' => 'App\User',
        'foreignKey' => null,
        'ownerKey' => null,
    ],

    'broadcast' => [
        'enable' => true,
        'app_name' => 'talk-example',
        'driver' => env('TALK_BROADCAST_DRIVER', 'pusher'), // pusher or laravel-websockets
        'pusher' => [
            'app_id' => env('PUSHER_APP_ID', ''),
            'app_key' => env('PUSHER_APP_KEY', ''),
            'app_secret' => env('PUSHER_APP_SECRET', ''),
            'options' => [
                'cluster' => env('PUSHER_APP_CLUSTER', 'ap2'),
                'encrypted' => env('PUSHER_APP_ENCRYPTION', false),
                'host' => '127.0.0.1',
                'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
                'scheme' => 'http',
                'wsHost' => '127.0.0.1',
                'wsPort' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
                'forceTLS' => false,
                'disableStats' => true
            ]
        ],
    ],


    'oembed' => [
        'enabled' => false,
        'url' => '',
        'key' => ''
    ]
];

in this new version broadcast section was added with talk config. Here broadcast is disabled by default. If you want to enable live (realtime) messaging then you have to enable it first. Then add pusher credentials to your .env file and you must add a new line called PUSHER_APP_NAME in the .env file to specify your application pusher name. Thats it. Everytime when you send message then talk will automatically fire two event, one for specific user and second for specific conversation. So you may listen or subscribe one or both as per your wish. Finally you have to subscribe these events by using talk_live() helper function. Go to where you want to subscribe to work with message data follow this code.

<script>
    var msgshow = function(data) {
        // write what you want with this data
        
        console.log(data);
    }
</script>

{!! talk_live(['user'=>["id"=>auth()->user()->id, 'callback'=>['msgshow']]]) !!}

talk_live() supports one parameters as array. The first parameter is for channel name which you want to subscribe. You have not know which channel was broadcast. Talk broadcast two channel by default. One for user and second for conversation. If you want to subscribe channel for currently loggedin user then you have to pass

logedin user id in 'user' key. ['user'=>['id'=>auth()->user()->id, 'callback'=>[]] or you want to subscribe for conversation id you have pass conversation id as 'conversation' key. ['conversation'=>['id'=>$conversationID, 'callback'=>[]]. You may pass both if you want.

You can pass a callback for working with pusher recieved data. For both user and conversation section support callbacks as array. So you can pass multiple callback as array value that was shown in previous example.

You can watch Talk-Live-Demo

Oembed support

Talk also supports embed urls simply use $message->toHtlmString() in you views to render an embed link

Eg. This is a youtube embed link: https://www.youtube.com/watch?v=jNQXAC9IVRw

<div class="message-container">
    <h2>Chat with {{$withUser->name}}</h2>
    @foreach ($messages as $msg)
     <div class="message">
        <h4>{{$msg->sender->name}}</h4>
        <span>{{$msg->humans_time}}</span>
        <p>
            {{$msg->toHtmlString()}}
       </p> 
    </div>
    @endforeach
</div>

Custom embed link

If you want to setup your own implementation of oembed you can configure it in the talk config file. You endpoint should follow the Oembed specifications

    'user' => [
        ...
    ],
    ...
    ],
    'oembed' => [
        'enabled' => true,
        'url' => 'http://your.domain/api/oembed',
        'key' => 'yout-auth-api-key'
    ]

Testing

Talk is backwards compatible with php 5.5. Use docker to run unit tests.

docker-compose run php55 composer install
docker-compose run php55 phpunit
docker-compose run php56 composer install
docker-compose run php56 phpunit
docker-compose run php7 composer install
docker-compose run php7 phpunit
docker-compose run hhvm composer install
docker-compose run hhvm phpunit

Try Demo Project

Talk-Example

Special Thanks To

Shipu Ahamed

Thanks :)

Support for this project

Hey dude! Help me out for a couple of ๐Ÿป!

Beerpay Beerpay

talk's People

Contributors

baileylo avatar cfpinto avatar harry34 avatar imanghafoori1 avatar lex111 avatar nafiesl avatar nahid avatar nazmulpcc avatar ptondereau avatar remo avatar sdkcodes avatar sh1hab avatar shenjiayu avatar shipu avatar smokills avatar x1mdev avatar xheinrich avatar zhengfen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

talk's Issues

where need to set global auth id ?

i have set id like this in MessageController Talk::setAuthUserId(Auth::id()); but when i send message error user_one cant be null it mens auth ID not inserting so do i want replace anywhere else ?

Facade not working

i followed the instructions in the Readme and got
Call to undefined method Nahid\Talk\Facades\Talk::setAuthUserId()

Custom user id column issue

In my User table the user id column is 'user_id' apart from default 'id' which is causing issue with Talk::threads() method as it is showing withUser->user_id and rest of the fields same to both the parties which is user one or the one who initiates the conversation.
the issue is fixed by changing the id field to user_id in

Nahid\Talk\Conversations\ConversationRepository

threads() method

$conversationWith = ($thread->userone->id == $user) ? $thread->usertwo : $thread->userone;

to

$conversationWith = ($thread->userone->user_id == $user) ? $thread->usertwo : $thread->userone;

May be you should define a variable for that in the talk.config for people having custom field names.

Does not send messages to Pusher

I'm using live-chat scripts. Does not send messages to Pusher. (Records I have in the database, appear on the page) Where can I find the error? I use Laravel 5.4

order conversations by latest message instead of latest conversation change?

Would it be possible to order the conversations of a user by its latest created message?

When a message of a conversation is deleted, its conversation's updated_at seems to change and the conversation moves to top of the list, although it has no new message....

I think it would be nice if only the conversation with the latest/newest message would be on top of the list. No changes in the conversation list if a message is deleted.

Unread and Read message count and messages

There is no function for read or unread message count. I can make my custom functions, but it increases the number of queries, which is not feasible for my system. And also show messages that are unread.
Please help.

App\Http\Controllers\Talk not found

Any reason I would get this error? I made a MessageController like so:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class MessageController extends Controller
{

  public function __construct()
  {
      Talk::setAuthUserId(auth()->user()->id);
  }

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
      $inboxes = Talk::getInbox();

      return $inboxes;
    }

In my config\app I added

'Talk' => Nahid\Talk\Facades\Talk::class,

in the aliases so not sure why I am getting that error.

Talk::setAuthUserId in Constructor doesn't work in Laravel 5.4

I'm using Laravel 5.4 and realized that Talk::setAuthUserId(Auth::user()->id), doesn't work in constructor anymore. I have to call Talk::setAuthUserId in all the methods (chatHistory, ajaxSendMessage, ajaxDeleteMessage) explicitly.

Is there a fix for this in the latest version of Talk.

Documentation not complete

Hi, just giving you a heads up. There are some functions that is not included in the documentation like Newconversation. Nice work, anyway!

'deleted_from_receiver' to be changed to 'deleted_from_reciever' in Talk.php

Hey the latest fix will not help.
Everywhere in the code it's 'deleted_from_reciever', changing the table column to 'deleted_from_receiver' will not help

All you need to do is change 'deleted_from_receiver' in Talk.php to 'deleted_from_reciever -- line 280

/nahid/talk/src/Conversations/ConversationRepository.php
/nahid/talk/src/Messages/Message.php
/nahid/talk/src/Messages/MessageRepository.php
all of the above files its 'deleted_from_reciever'.

Cant send a message

I implemented your example sites and all works fine.
I just simply cant send messages. Everytime i hit the "Send" button it gives back these 2 errors:
Uncaught TypeError: Cannot read property 'trim' of undefined(โ€ฆ)render @ index.js:30addMessage @ dispatch @ jquery.js:4430r.handle @ jquery.js:4116

POST http://localhost/ajax/message/send 500 (Internal Server Error)send @ jquery.js:8625ajax @ jquery.js:8161(anonymous function) @ talk.js:16dispatch @ jquery.js:4430r.handle @ jquery.js:4116
jquery.js:8625 XHR finished loading: POST "http://localhost/ajax/message/send".send @ jquery.js:8625ajax @ jquery.js:8161(anonymous function) @ talk.js:16dispatch @ jquery.js:4430r.handle @ jquery.js:4116

Built With Talk

Please share your project which is built with Talk for messaging, chatting or forum app.

Frontend Layout

Hi,

Could you share your frontend layout? its really clean :)

Thanks

Facede Error

Please update your service provider. New installations giving Facede Error.
on line 72 $this->app->alias('talk', Talk::class); to $this->app->alias('Talk', Talk::class);
on line 82 return ['talk']; to return ['Talk'];

termimal show `Trying to get property of non-object`

After I installed talk using composer,added talk's service provider and alias into app.php,if I use php artisan route:list to list all my route,the terminal show errors to me :

  [ErrorException]                      
  Trying to get property of non-object

Can`t Rollback

While rollback tables we have issue.

in database/migrations/**create_messages_table.php
public function down() { Schema::drop('message'); }
change to
public function down() { Schema::drop('messages'); }

QueryException in Connection.php line 662:

I am getting below error invoking getInbox() method in my Laravel application , Can you please suggest a fix .

QueryException in Connection.php line 662: SQLSTATE[HY000]: General error: 2031 (SQL: SELECT user.id as receiver_id, user.name, msg.user_id as sender_id, conv.id as conv_id, msg.message, msg.created_at, msg.is_seen
FROM users user, conversations conv, messages msg
WHERE conv.id = msg.conversation_id
AND (
conv.user_one = :user
OR conv.user_two = :user
) and (msg.created_at)
in (
SELECT max(msg.created_at) as created_at
FROM conversations conv, messages msg
WHERE CASE
WHEN conv.user_one = :user
THEN conv.user_two = user.id
WHEN conv.user_two = :user
THEN conv.user_one = user.id
END
AND conv.id = msg.conversation_id
AND (
conv.user_one = :user
OR conv.user_two = :user
)
GROUP BY conv.id
)
ORDER BY msg.created_at DESC
LIMIT :offset, :take)

Routes, controllers and views

As a suggestion, it would be great to have an example of controllers routes and views to integrate it in 10 minutes :D

Illegal offset type on doing php artisan route:list

on accessing message/inbox route after login and on doing php artisan route:list, showing Illegal offset type error :

ErrorException in Controller.php line 50:
Illegal offset type

I am using laravel 5.1
Nahid, could you help me ?
Thanks in advance.

Session not working in your project

I have used your example project code and i saw you have used

protected $middleware = [
        \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
        \Illuminate\Session\Middleware\StartSession::class,
    ];

so when we use this project other session not working our project if we comment this startsession getting error trying to get non object so what is the best way to use session with your example project code ?? https://github.com/nahid/talk-example
and if we install this our existing project we have to put \Illuminate\Session\Middleware\StartSession::class, line into kernal so i can't use session message .........

Route tests

Hi;

In route /tests I have an error.

Call to undefined method Nahid\Talk\Talk::channel()

Pusher Support

Hello,
is pusher really working ? cause I checked the master and talk_live function is not called anywhere

Yii2 version

This project looks absolutely amazing. Any chance you're porting this to Yii2 soon?

get only messages which are not softdeleted

Hello.
How can I get only the messages which are not deleted_from_sender ?
I show a conversation to a specific user and when I softdelete a message, it is still shown after it has been marked as deleted_from_sender.

It is good that a user can softdelete his/her copy of a message. But then I still see it.

    $messages = null;
    $conversations = Talk::getConversationsByUserId($user->id, 0, 20);
    if($conversations){
        $messages = $conversations->messages->reverse();
    }

The ->messages does not seem to check if the messages are softdeleted:

select * from `messages` where `messages`.`conversation_id` = '2' and `messages`.`conversation_id` is not null

Maybe I just don't see right the method/function..
Thanks for help.

What is status column in Conversations table for?

I'm interested in knowing if a conversation is replied to or not, do i have to do find it by checking the last message or is there any other implemented method already as i cant find it in documentation.

demo/

do you have any basic example ou demo ?

SendMessageByUserID

sendMessageByUserId($userId, $message)

Hi, have a poser , when sending emails to the user (user_id), a letter comes constantly to himself .

getMessagesByUserId , offset & $take not working

i'm using the test example and i try to edit

i'v 122 message in the db
$conversations = Talk::getMessagesByUserId($id);
to
$conversations = Talk::getMessagesByUserId($id,0,10);

it return 122 every time

i think the main problem is here
$this->makeMessageCollection($conversations);
>>>
$collection->messages = $conversations->messages;

this call the messages relation without any limit .

User Feedback

Please share your experience with Laravel Talk. Its helps to make the project better.

Got error when run php artisan route:list command

I got this error message when running php artisan route:list command:

PHP Fatal error: Trait 'Illuminate\Foundation\Auth\Access\AuthorizesResources' not found in /home/fahri/Projects/thdc/project/vendor/nahid/talk/src/Example/TalkController.php on line 16

while migrating

php artisan migrate

[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Illuminate\Notifications\NotificationServiceProvider' not found

SQL syntax error

Hello , I have an error when calling the getInbox() method (use laravel 5.3):

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'OR conv.user_two =
) and (msg.created_at)
in (
SELEC' at line 6 (SQL: SELECT user.id as receiver_id, user.name, msg.user_id as sender_id, conv.id as conv_id, msg.message, msg.created_at, msg.is_seen
FROM users user, conversations conv, messages msg
WHERE conv.id = msg.conversation_id
AND (
conv.user_one =
OR conv.user_two =
) and (msg.created_at)
in (
SELECT max(msg.created_at) as created_at
FROM conversations conv, messages msg
WHERE CASE
WHEN conv.user_one =
THEN conv.user_two = user.id
WHEN conv.user_two =
THEN conv.user_one = user.id
END
AND conv.id = msg.conversation_id
AND (
conv.user_one =
OR conv.user_two =
)
AND (
(
msg.user_id =
AND
msg.deleted_from_sender = 0
) OR (
msg.user_id !=
AND
msg.deleted_from_receiver = 0
)
)
GROUP BY conv.id
)
ORDER BY msg.created_at DESC
LIMIT 0, 20)

Convert to Live Webchat

Hi,

Can this be converted to Live Webchat Laravel module as it seems to be for the registered users only within talk system?

Thanks
Vik

File sending

Is it possible to attach files along with messages? If not, some pointers on how that can be done, please.

Talk::getInbox();

I try to use this function, but it returns only conversations where I'm a sender.
Is it right?

To get all conversation ( where I'm is as sender and where I'm is a replyer) which function do I need to use?

About Installation and Route List Error

I have Installed your project to laravel 5.1 and 5.3. After Installation I got error which is provided below
[Symfony\Component\Debug\Exception\FatalErrorException]
Trait 'Illuminate\Foundation\Auth\Access\AuthorizesResources' not found
Your package is not working yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.