laravel-model-settings
laravel-model-settings copied to clipboard
[Proposal] Removed Model::getConnectionName() override
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()togetLaravelModelSettingsConnectionName(), which, in turn, callsgetConnectionName()and handles the fallback. - Don't worry about the fallback. I think that
Modelwill eventually fall back to the default connection. (SeeIlluminate\Database\ConnectionResolver.) - ...?
Let me know if you have questions/concerns, and thanks for the great work thus far. 🤓
The getConnectionName() function also conflicts with the Tenancy for Laravel package. I would love to see this PR merged.