laravel-achievements icon indicating copy to clipboard operation
laravel-achievements copied to clipboard

Choose which database the tables reside in

Open vgsh opened this issue 7 years ago • 3 comments

Is there a way to configure the used database for the achievements (details and progress)?

I use a system containing multiple databases, and the achievement tables should not necessarily reside in the default database.

I got a working version by directly editing the source code, but this would not be future proof, as newer versions would just overwrite it.

vgsh avatar Aug 31 '18 07:08 vgsh

Hi @vgsh !

Right now there is no feature for this. But it's a good idea - I could add the table names to the config file.

Which files did you edit to make it work? We can work together and add a pull request implementing this change for the next release.

gabs-simon avatar Aug 31 '18 20:08 gabs-simon

Hi @gabriel-simonetti !

Thanks for your answer.

I added the $table property in both Models (AchievementDetails and AchievementProgress). This was all I did, I think.

The $table value I set is "[database_name].[table_name]".

vgsh avatar Sep 01 '18 08:09 vgsh

Hi @vgsh !

I have added a feature for changing the tablenames on a config file. It's on the master branch now and you can expect it for the next release of the package.

Thanks a lot for letting me know about this issue!

gabs-simon avatar Sep 15 '18 09:09 gabs-simon