Open stefvanesch opened 11 months ago
This seems like a valid issue, but rather rare one and easily fixable by extending our MenuBuilder tool class. Personally feel like this doesn't deserve us bloating our configuration file.
Since it's a tool class and not used internally, I recommend you extend it in your own project and call your class with updated methods inside the tools function in NovaServiceProvider class.
Since it's a tool class and not used internally
I was wrong about this, we use it internally to, which complicates the solution a bit, but with relative ease you can still override the vendor class in your project.
https://github.com/outl1ne/nova-menu-builder/blob/main/config/nova-menu.php#L18
@stefvanesch if you assign your table name to connection.table_name
, it should already try to look up the correct database connection and table. Could you try it, I think that solves your problem the easiest.
@KasparRosin sadly that didn't work for us. I'm not sure why not anymore. We've forked your package and added the changes there to make it work for our situation.
We are using this package for a websites that is multi tenant using the spatie package. We now have an issue where the validation if a menu exists will fail because it will check the landlord database.
The menu's in this case are stored in the tenant database so we need to overrule the database connection in the validation. We will create a pull request to address this issue.