cmgmyr/laravel-messenger

How are you using laravel-messenger?

cmgmyr opened this issue ยท 67 comments

Please leave a comment explaining how you are using this package. How many users are you supporting? What type of features have you had to implement to extend the base functionality of this package?

*If you have any issues, please open up a new ticket. Please keep this thread for feedback only. Thanks!

Implementing it for a Unit Manager internal messaging system. We aim to support at most 150+ users. Currently only using base functionality. I'll update I add anything more. Thanks for this awesome package!

We are using it for the same that mrgwilliam, but we are also implementating a notification system with other parts of the site. We have around 500 users in the site but the messenger is still in beta.

we are implementing it in an in-school network , however , having seen laravel 5.1 shouldbroadcast , we are thinking about using socket.io to build a realtime messaging platform , have you given any thought about this ? there's a package called 'confer' that already does this but with pusher

We are using it as a facebook-like private message system in a community website.
Thanks for this package !

Thank you all for the great feedback so far!

@Pandahisham in the new version I'm planning on using events, so you'll be able to hook into those pretty easily. You'll still have to handle the front end processing on your own. I don't think it makes sense (at least at this time) to do anything with Pusher, or other services, inside this package

yap ! we will handle the frontend ourselfves , just give us a well documented package with hints to how it may work with say pusher or socket.io , leave the rest to us

IJack commented

Thanks for the nice package, works fine.

But I got an error when I make a migration:refresh after a time: Class "AddSoftdeletesToThreadTable" not found. The migration file with it class is in the migration folder. Don't know what I'm doing wrong

@Pandahisham just check this repo. It's pretty good boilerplate to make this package work with Pusher https://github.com/cmgmyr/laravel-messenger-pusher-demo

@a-komarev and @cmgmyr thanks !! i may have to re-purpose that to socket.io though

How can I run this in my project , I have no idea... .. I followed all the instructions but its not working :( I am using laravel 4.2 version ...anyone here to help me please!!

@talha08 if you have a specific thing you need help with, please create a new issue ticket with more information. This isn't the correct issue for help. With Laravel 4, you should be using the 1.x version. I hope that helps.

@cmgmyr Using it as a personal messaging system with the phphub china community forum.
you could check it out here. Phphub++

In a Game-Webinterface for an Arma3 Altis Life Server.

AS additional features I've added Markdown and a PHP side Twemoji Class that replaces some codes with the SVGs for the twemojis.

For me this is a very good package cause it just comes with the needed things and is easy customizable.

bgies commented

I'm not using it yet, but I'm planning on using it to support messaging between the website admins and the users... it seems very well suited for that

sger commented

Great package just created a demo app with Laravel 5.2

https://github.com/sger/laravel-messenger-demo

Thanks for the demo @sger! I've been toying with the idea of making a live working demo that people can log in to, but just haven't had the time recently. Definitely on my to-do list though.

Great package just created a demo app with Laravel 5.2

https://github.com/sger/laravel-messenger-demo

404 :(

I'm using it for a friends messaging system :) Planning on using this for a open forum type as well.

Thanks!

Hi, in my website there are two different kinds of users(multi auth), let's say "cop" and "thief" instead of one kind of "user". Can I still use this package?
Thanks!

@xuan9230 of course. You can extend Thread model or even write your own to fit your requirements. This package provides a structure which you can adapt for your needs.

@a-komarev So I've noticed "user" appears a lot in several files (Thread, MessengerServiceProvider, Participant...) Should I change every single one of them? That seems to be such a huge workload...

@xuan9230 nope, all you have to do is publish the config file and update the reference to the "user" model you want here. All of the references to your model will get mapped automatically. Also, if you have any questions/issues with the package, please open a new ticket so we can reserve this one for feedback related comments

@cmgmyr thanks man! I will open a new ticket once I figured out the entire process:)

@cmgmyr implementing it on our private network! :D Thank you for this package.

@cmgmyr Realy nice package you have here! Thanks a lot! I would like to use it in my project as some sort of private direct messaging service betweens users. But I can't seem to find a way to make it "private". I used to code provided in the controller to show only the threads you are participating in so that's cool but you can still go to the "messages" you are not participating in by changing the url like so for example: "messages/1". Is there a way provided in your package to make this secure? Thanks in advance!

@Moussa112 thanks for using the package! There isn't anything built directly into this package for private one-to-one messaging, I left that up to the developer since there are multiple ways that you can implement it. Please take a look at #29 for some helpful info. I'm going to be writing up some additional information about how to do this soon.

We implemented an internal messaging module in our private course website thanks to your package. Also, we made some modifications to send bulk messages to everyone.

image

Thanks for sharing @cihadturhan, the site looks great! I really like the page layout too. How did you handle the bulk notifications? Just sending out one-to-one messages to everyone from an admin user?

Any idea how much simultaneous connections it can manage ? planning to implement it on a project where tons of chats may take place.

@Naveen95 that's really up to your server infrastructure. Laravel can handle many concurrent connections. If you want more of a real-time chat, you should probably look into other technologies instead of PHP. This really depends on your project and how you want to implement it.

any working demo ?

@naumanahmed19 unfortunately, nothing "official" at the moment, but if you look at my repos you'll see a number of tests in different versions of the framework that you can pull down and play with. They all come with migrations and seeds to get you up and running.

@cmgmyr any idea how to developing realtime application using laravel 5.2 using sockets [ I tried vinelab/minion (built using crossbar.io) but it's not working correctly in my laravel environment ]

My goal was to implement one to one messaging system using this package. I must say this is really awesome package, with little changes to example controller and created my own views and it's live in few hours.

We implemented it in JustBeFriend.com

Thank you very much everyone who contributed to this repo, and keep up the good work.

I'm looking for a system where it's Admin -> many Users / one User and user -> Admin only. No messaging between users.

Does this package fit our requirement?

Thanks ;)

PS: Any real live demo would be good though

@yanseo Yes, you can use this package for that. You'd have to build the rules around who can contact who though, but the base messaging functionality would still be the same.

How easy would it be to send system generated messages to users with this package?

Such functionallity is build into laravel
https://laravel.com/docs/5.3/notifications

@watchwood - like @Promixius stated, notifications would be better for this. You could use this package to accomplish something similar, but it's certainly not ideal (IMO)

Does it compatible with Laravel 5.3 ??

@sidor555 yes

Hi... When I'm trying to migrate database it's showing. I already have a messages table in my database. I think this maybe a problem --> Cannot redeclare class CreateMessagesTable ..... So now what to do ??

@sidor555 can you please open a new issue with more information?

reliq commented

We're using your package here and at studentroomsja.com.

Thank you for an awesome package man!

๐Ÿป cheers!

Very cool @reliq, thanks for sharing!

Sorry @reliq ,i can't find this package on studentroomsja.com :(

reliq commented

Hey @asimshazad, we're basically it for the member chat feature on that site (http://stuentroomsja.com). The feature isn't actually open to the public. The chat is currently only available to people with 'room requests'.

Hi, can i add attached-file fonctionnality to this package ? thanks.

@Rostom22 For questions its better to make issues. This thread used to share projects where this package is used. Answer to your question: #162

Hi anyone has one-to-one messenging feature example project?

Thank you for creating this package. Although I have created similar PM systems in plain-php, I didn't want to re-invent the wheel this time. Took some hours of modifying and this is the result. It's an implementation for my bachelor's thesis project. ;)
My example

I use Laravel. I combine the laravel-messenger with email notification with Mailgun and Amazon SES. Working very very good. User can also send message directly to Admin without knowing who the Admin is (with admin role). I also use Summernote rich text editor so laravel-messenger message body could contain image, picture, video link, etc. I have planning to create chat directly from Post model, but still considering it given that comment section is provided. User can also opt to 'GetMeOut' if he/she does not longer want to be included in the thread message (although I assume his/her boss will get angry because the App is intended to be used in a company)
thread_lq
thread_admin
thread_notifemail
thread_unsub

so cool, thanks for sharing!

can I use this package with two separate models? "User" and "Manager" ??

@Mu9tafa-Online I want that too ๐Ÿ‘

We're using this package to provide instant messages to our users. Glive connects artists, agencies and contractors. They can meet new contacts and keep in touch with messages. We're developing more advanced messaging features like contract attachments, event planning and more.

This package allows the customization of the message system to our needs. Thank you for this excellent package.

https://glivesol.com
messenger_demo_2

Please helps me here, i have a serious problem, use Laravel 5.8 i really need your helps

https://stackoverflow.com/questions/59249412/get-the-users-who-are-sent-themselves-of-the-messages-with-the-last-messages-and

@alkaou this thread is not for asking for help. Please add a new, detailed, issue in the repo or wait for someone to respond on stack overflow.

Actually started using this package along with an expanded version of this package (https://github.com/lexxyungcarter/laravel-5-messenger) as a base in April 2018, but ended up extracting out your SRC files, using the models as a base reference, and building back up from scratch. We needed to be able to message between any models we choose, so switched to using morphs on everything. Ended up building so much on top, I am starting to extract it out into a standalone package I too would like to release as an entire suite! But your base helped us get the jump start we needed, so thanks! I added support for group invite links like discord, video calling/group calling, bobble heads (read indicators), images, documents, links, youtube support. Privacy and friends list are also integrated

71425952-e5187780-2670-11ea-8390-583970b6ba82

71425992-5821ee00-2671-11ea-94a5-488215856885

thanks for an awesome package....
Dashboard_BinaKarir

thanks for an awesome package....
Dashboard_BinaKarir

Hello I know its bit late to ask a question. But I would like to know how to show the conversations in timeline mode like you are doing?
I am using $thread->messages to display all the messages between two users. But I want to display the message from the sender like you are doing in blue and the receiver of the message in white. I want to implement the conversation view like you are doing. How to achieve it? Kindly help.

Hello. I am rebuilding my website and looked a package for messages between users. Your package looks nice but i added two changes.

Firstly. In Thread model i added new scope:

    /**
     * Returns threads that the user is associated with and sorts start from unreads.
     *
     * @param \Illuminate\Database\Eloquent\Builder $query
     * @param int $userId
     *
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public function scopeForUserOrderByNotReadMessages(Builder $query, $userId)
    {
        $participantTable = Models::table('participants');
        $threadsTable = Models::table('threads');

        $orderBy = 'IF(`' . $participantTable . '`.last_read IS NULL, 2, IF (`' . $threadsTable . '`.updated_at>`' . $this->getConnection()->raw($this->getConnection()->getTablePrefix() . $participantTable) . '`.last_read, 2, 0)) DESC';
        return $query->join($participantTable, $this->getQualifiedKeyName(), '=', $participantTable . '.thread_id')
                ->where($participantTable . '.user_id', $userId)
                ->whereNull($participantTable . '.deleted_at')
                ->orderByRaw($orderBy)
                ->select($threadsTable . '.*');
    }

Secondly. I modified getParticipantFromUser method.

    public function getParticipantFromUser($userId)
    {
        if ($this->relationLoaded('participants')) {
            $participant = $this->participants->where('user_id', $userId)->first();
            if (is_null($participant)) {
                throw new ModelNotFoundException();
            }
            return $participant;
        }
        return $this->participants()->where('user_id', $userId)->firstOrFail();
    }

And i used this:

Thread::forUserOrderByNotReadMessages($userID)->with(['participants' => function ($query) use ($userID) {
        $query->where('user_id', $userID);
    }])->latest('updated_at')->paginate(50);

These changes reduce the number of queries and the page loads faster :)

I'm studying laravel and I've decided to rebuild an application using it.
One of the new features will be users chat and your package was just what I needed.
Made some adjustments to star and archive messages and thats it!
Thanks a lot for the great work!
Here is how it looks...

chat-demo

Hello every bady
88055316-2a345780-cb35-11ea-8f20-664ab2f2f87e
Mana natija

Using this project to power messaging on our platform.
simulator_screenshot_7272839B-FDA6-4E30-B920-FA228BBB9ADF

It works great.