musonza / chat

A Laravel chat package. You can use this package to create a chat/messaging Laravel application.
MIT License
1.12k stars 308 forks source link

Make connection on models configurable #306

Closed inmanturbo closed 5 months ago

inmanturbo commented 2 years ago

This allows developers to override default connection on package models by adding a key of database_connection in config/musonza_chat.php. I would like to use this in a project I am working on right now but I am unable to because I need to use a different database connection from the default. This change will not affect existing applications already using the default connection. No configuration changes are need for migrations, one can simply pass --database[=DATABASE] at the time of migration.

Please accept my pull request so that I may use this package. Thank you!