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

[Proposal] Removed Model::getConnectionName() override #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

telkins
Copy link

@telkins telkins commented Apr 26, 2024

This is a great package, but it overrides Model::getConnectionName(), which proves to be a problem. We already have simple traits that do something similar and we can't have both.

This solution moves the fallback call to config() (which one could argue might not be necessary) to the two instances where getConnectionName() is called.

Alternatives:

  • Change getConnectionName() to getLaravelModelSettingsConnectionName(), which, in turn, calls getConnectionName() and handles the fallback.
  • Don't worry about the fallback. I think that Model will eventually fall back to the default connection. (See Illuminate\Database\ConnectionResolver.)
  • ...?

Let me know if you have questions/concerns, and thanks for the great work thus far. 🤓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant