Can you have multiple conversation between the same users ? Or just one ?
You can have private multi conversations with all users you want :) all users can have chat with every numbers of others users in the same conversation or different .user ALPHA can have chat with user BETA but can have only 1 conversation between them. But ALPHA can have another chat with BETA & GAMMA.
This is exactly what I was making myself. But will probably switch to your package. Looking perfect.
That's good, I'm glad if I save you a bit of time. I think it is a good package. You can make a complex chat in 1 hour. Obviously this is still a fresh package released 2 hours ago, Is fully unit tested, and I implemented on my current project so i can use it and improve it and hopefully without find any bug :)
It's not working for me. The problem has something to do with
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'trinity_development.participants' doesn't exist (SQL: select `conversation_joined`.*, `participants`.`participant_id` as `pivot_participant_id`, `participants`.`conversation_joined_id` as `pivot_conversation_joined_id` from `conversation_joined` inner join `participants` on `conversation_joined`.`id` = `participants`.`conversation_joined_id` where `conversation_joined`.`deleted_at` is null and `participants`.`participant_id` = 1 and `participants`.`participant_type` = Trinity\Models\User)
mmmh Can you tell me witch method you used i may miss something, can you be a bit more specific :)
I'm currently using the package i didn't meet this issue. I will glad to help you. Do a composer update i fixed other staff
I used the relationships provided at the documentation. That is causing this error.
I'm just getting the conversations like so
Auth::user()->conversations
If you want to get conversations of a specific user you have to use
Mex::conversation()->from($user_id)->lists();
Because like so Mex will check if the user has some conversations deleted or in archive, and it will not get them.
if you instead use Auth::user()->conversations it will get all the conversations even deleted or in archive so is not useful.
I got the same error trying to do what you said, but chancing the realtions to:
public function conversations()
{
return $this->morphMany('Fenos\Mex\Models\ConversationJoined', 'participant');
}
public function messages()
{
return $this->morphMany('Fenos\Mex\Models\Messages', 'participant');
}
Will fix the problem but still is not the right wait to use Mex :). Remember to update the version to 1.0.3 :) Hope you enjoy it
I'll create a trait, like so i can manage the relations for each update
The first time that I have free time I'll make a demo of it :)
I agree .. a demo would be quite useful.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community