Open SteamWind opened 6 years ago
Okay, saving table prefix in database causes a lot of problems, after using my fix, it seems to have a lot of place where we can't use the table name with the prefix. We need to save the table name without prefix. I tested to use the relations without the prefix saved in the DB and it seems to work everywhere.
Description:
There is a bug with pivot table with prefix on display, it prefix the already prefixed table. Which causing this error:
When we create the relationship, we need to put the prefix out of the name of the pivot table. I did something locally but it doesn't fix the bug at the core (I tried to fix it at the core but I don't have the level). I changed this line here and this other line with this on the creation of the belongsToMany relation:
We could fix the problem at the core but it changes a lot of thing and I don't think it's really the right solution because we should save the pivot table without prefix in the database as we store all other tables with the prefix. I don't find it consistent.
Let me know what you think about that, I'm open to any suggestions. If this fix is okay for you, I'll open a PR.
Steps To Reproduce:
You should reproduce this error: