[pull] 0.x from laravel:0.x#83
Merged
Merged
Conversation
* Scope remembered conversations by participant type Conversations are keyed only by the participant id, so different authenticatable models that share an id (e.g. User #1 and Admin #1) resolve to the same conversation history via continueLastConversation(). Add an opt-in user_type discriminator that isolates conversations by the participant's morph type in addition to its id. Disabled by default, so existing single-provider applications are unaffected. Closes #666 * Replace conversation type scoping with a participant store seam * Expose conversation participant scoping via opt-in store interface * Provide first-party participant_type support for conversations Bake participant type into the schema, store contract, and relationships so conversations owned by different authenticatable models that share an id (User#1 vs Admin#1, tenant-scoped owners) no longer collide. - create migration: rename user_id -> participant_id and add nullable participant_type on both tables; null participant_type means the configured user model, any other model stores its morph class - ConversationStore contract threads a participant type through every read/write; the ParticipantAware opt-in seam is removed - DatabaseConversationStore and HasConversations probe Schema::hasColumn at runtime so existing user_id-only installs keep working unchanged; gaining participant_type is opt-in via a self-written upgrade migration - new ai.conversations.participant_model config designates the null-type default model, defaulting to auth.providers.users.model Closes #164, #596, #666 * Fix code styling * Fix null owner column being silently dropped from conversation inserts * Fix it. * Make participant type a trailing optional parameter on the store contract * Fix participant_id column definition in migrations * make participant required * Resolve participant keys via getKey and expose the inverse participant morph * Use instanceof Model when resolving participant morph values * update upgrade guide * Guard participantKey against objects without an id * Use string participant_id columns in test schemas --------- Co-authored-by: Dhrupo Nil <dhrupo@gmail.com> Co-authored-by: Taylor Otwell <taylor@laravel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )