Team-Tea-Time / laravel-forum

A slim, lean forum package designed for quick and easy integration in Laravel projects
https://laravel-forum.teamteatime.net/
MIT License
601 stars 165 forks source link

Can I install it on a separate database? #273

Closed seatechdev closed 3 years ago

seatechdev commented 3 years ago

Laravel allows support for multiple databases eg -mydb1, mydb2. Lets say mydb1 has the main app. Can this be installed on mydb2?

Riari commented 3 years ago

You could run the migrations on a separate database easily enough, but the package is unfortunately not written to explicitly select a connection for any of its queries, so it only uses the default connection.

One way around this would be to set the connection to mydb2 as the default and change your application code to explicitly select the mydb1 connection, but if you use any other packages that execute DB queries then that might not be an option for you.

I might consider it as a feature request if enough people want it, otherwise I'm open to PRs.