-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use 'driver' option #16
Comments
I did not extend Eloquent, but replaced the DatabaseManager/Builder below. The session drivers are separated from the database. |
It looks like when the Session system is set to "database" it goes through this path https://github.com/laravel/framework/blob/master/src/Illuminate/Database/Connectors/ConnectionFactory.php#L64 (either createConnector or createConnection). My temporary solution is to extend the session system and add a "mongo" driver, however I feel like this could be something that would be better suited at a lower level. |
It does indeed call the ConnectionFactory to get the internal PDO object. There is no easy way to get the session system working without a MongoDB session handler. |
But I will look into MongoDB supported sessions soon. |
Check out https://github.com/jenssegers/Laravel-MongoDB-Session It adds a mongodb session driver. |
That is immensely helpful. Thanks. Regarding the initial reason for this issue though, can you look into getting the database connections based on the "driver" property rather than the key? Right now multiple connections feels kind of janky. |
It looks like 5c6a971 might fix these issues, and from everything I've seen it looks great. Does this also mean that the session driver is no longer necessary? Edit: I think the driver is still necessary (but might require modification) |
I did indeed manage to extend the original database manager with a driver. However, this does not change anything for the session driver, so it is still needed. |
The only thing that has changed for the session driver is to use the new database manager: jenssegers/laravel-mongodb-session@1ad7858 |
Bugfix add collection with options
Bugfix add collection with options
Rather than looking for a connection with a specific name I think it would make more sense to go by driver to follow standard.
Ideally rather than extending eloquent this might extend the database connection system instead, so things like sessions
and eloquent"just work" as a result.The text was updated successfully, but these errors were encountered: