Skip to content

Conversation

@alcaeus
Copy link
Contributor

@alcaeus alcaeus commented Feb 21, 2023

This improves the behaviour of database collections when using non-scalar primary keys by using the same dictionary behaviour used elsewhere.

The use case is the jenssegers/laravel-mongodb library, where identifiers may be non-scalar values. Using InteractsWithDictionary fixes this for all stringable objects directly, but also would allow us to support other complex objects by overriding the getDictionaryKey method without having to override all methods making use of the dictionary.

This improves the behaviour of database collections when using non-scalar primary keys by using the same dictionary behaviour used elsewhere.
@alcaeus alcaeus force-pushed the eloquent-collection-dictionary branch from 6a77163 to d7f2afb Compare February 21, 2023 09:27
@taylorotwell taylorotwell merged commit d91e03a into laravel:10.x Feb 21, 2023
@alcaeus alcaeus deleted the eloquent-collection-dictionary branch February 21, 2023 11:39
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.

3 participants