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

Model extending, non default database connection causes errors on create #1978

Open
ryanmitchell opened this issue Oct 4, 2024 · 0 comments
Labels
bug Something isn't working unconfirmed

Comments

@ryanmitchell
Copy link
Contributor

We are extending ProductVariant in order to add some of our own logic to it. We have our lunar models using a separate database connection to the rest of the site (specified in lunar.database.connection).

Everything works fine except creating new products. When you submit inside the modal, we get the error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table '{database}.lunar_product_variants' doesn't exist (Connection: mysql, SQL: select count(*) as aggregate from lunar_product_variantswheresku = 123)

{database} is the default database, not the lunar one.

The stack trace is pretty unhelpful, its mostly inside illuminate connection classes and filament interacts with forms. I can't see anything related to Lunar, but obviously this is being caused by model extending.

Are you able to replicate it and see if you can find a solution?

@ryanmitchell ryanmitchell added bug Something isn't working unconfirmed labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
None yet
Development

No branches or pull requests

1 participant