Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database prefix #1

Open
kreativitat opened this issue Jul 15, 2023 · 2 comments
Open

Database prefix #1

kreativitat opened this issue Jul 15, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@kreativitat
Copy link

The problem arises when attempting to use the Caprel\Dolibarr package in conjunction with a custom database prefix. Despite setting the desired prefix in the package's configuration, it appears that an additional "dolibarr" prefix is being appended to the table names. This causes conflicts when interacting with the database, as the package expects table names with the "llxnm_" prefix, rather than "llxnm_dolibarr_".

As a result, any queries or operations performed by the package fail to locate the corresponding tables due to the mismatched prefixes. This issue impedes the seamless integration of the Caprel\Dolibarr package within Laravel applications that rely on custom database prefixes.

I have reviewed the package documentation and attempted to modify the prefix using the available configuration options, but unfortunately, these steps did not resolve the problem. Additionally, I explored alternative approaches, such as extending the package's classes and directly modifying the code, but these workarounds did not provide a satisfactory solution either.

I am reaching out to you to seek guidance and assistance in resolving this matter. It would be greatly appreciated if you could review the issue and provide any insights or suggestions on how to address this conflict effectively. If there are any modifications or updates that can be made to the package to support customization of the database prefix, it would greatly benefit users who rely on Laravel with custom database prefixes.

I am more than willing to provide any additional details, error messages, or code snippets that could assist you in investigating this issue further. Please let me know if there are any specific steps or tests I can perform to help diagnose the problem and work towards a resolution.

Thank you for your attention to this matter, and I look forward to your response. Your expertise and support in resolving this issue would be immensely valuable.

@kreativitat
Copy link
Author

I've solved the problem adding to the user model

protected $table = 'user';

@rycks
Copy link
Owner

rycks commented Jul 15, 2023

Good morning @kreativitat,
I think there is a big misunderstanding on the fundamentals of this module...

This module is not made to connect directly to the dolibarr database but to the dolibarr RESTfull API...

So do not try to add anything as a prefix or other stuff: it is totally invisible at the level of the laravel application since you connect to the dolibarr API and it is therefore the dolibarr API that is loads 'locally' to use its prefix which is not at all visible/known/communicated to the laravel application...

@rycks rycks added the documentation Improvements or additions to documentation label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants