Comments (11)
Hi @bhdrnzl ,
An update has been released and you can update to the latest release.
Cheers.
from laravel-5-messenger.
Hello there,
Would you post a snippet of your code to illustrate this? Thank you.
from laravel-5-messenger.
Hi @lexxyungcarter ..
I guess I couldn't tell you what the problem was. When a user leaves the chat, the other people continue to chat and the user continues to send new message notifications. The message does not appear because the user has left the chat, but the notification icon is lit.
With this code, the user leaves the conversation.
`
public function leave($id)
{
$thread = Thread::find($id);
$thread->removeParticipant(Auth::id());
if ($thread) {
toastr()->success('Ok..');
return back();
} else {
toastr()->error('No..');
return back();
}
}`
I can see in the database that I left talking, but the notification continues to go.
PhpMyadmin screenshot: https://ibb.co/RhXFKS5
i removed this code:
$thread->activateAllParticipants();
still notifications are coming..
from laravel-5-messenger.
Cheers, sir. I am grateful to you for preparing such a package because I use it in all my projects. And thank you for paying attention to the problem.
from laravel-5-messenger.
public function leave($id)
{
$thread = Thread::find($id);
$thread->removeParticipant(Auth::id());
if ($thread) {
toastr()->success('You left the conversation');
return back();
} else {
toastr()->error('You cant leave conversation');
return back();
}
}
from laravel-5-messenger.
@lexxyungcarter Is there a clue about this error?
from laravel-5-messenger.
Hi @bhdrnzl ,
Let me set up a simple demo to replicate the issue.
from laravel-5-messenger.
Hello @bhdrnzl ,
When sending the message, could you be calling
$thread->activateAllParticipants();
Because if you do so, all previously removed participants will be included back to the conversation. try commenting the piece of code and see the results.
I have set up a simple demo app over here.
The complete working demo is demonstrated here.
Also, make sure to update to the latest version of the package (version 1.0.7). It includes some important updates.
from laravel-5-messenger.
Hi @lexxyungcarter,
Thank you for working. I copied the MessagesController.php file in your example and added it to my own project. The notification continues to go to the user leaving the chat.
from laravel-5-messenger.
Ok. If that is the case, you can simply comment that line in the update()
method
// comment or remove this to avoid activating all participants
// (including those who have been removed from a thread conversation
$thread->activateAllParticipants();
and then test your app.
from laravel-5-messenger.
@bhdrnzl It's always a pleasure helping others out.
Cheers!
from laravel-5-messenger.
Related Issues (20)
- Had to edit models HOT 2
- Starred property HOT 2
- I can use two user's table? HOT 1
- Wow! How are you using this package so far? HOT 1
- Vue js ^3.0 + tailwind css >=2.0 examples; Garner 10+ votes or Donos to kickstart Laravel Inertia/Nuxt/Vue/React Native demo development HOT 5
- Integrate Pusher on Laravel 5.6 HOT 1
- Extend Messages Model HOT 1
- extend message model to everride it's fillable HOT 1
- Pusher integration HOT 6
- send message individual HOT 1
- how to create group chat using this package HOT 1
- Group by date
- pusher integration problem HOT 9
- Demo link is broken
- No realtime updates conversation? HOT 3
- user column name HOT 2
- Laravel 5.8 supprt? HOT 3
- Thread::participantsString() fail with custom User table HOT 5
- One Thread by user (Like Facebook Messenger system) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-5-messenger.