Skip to content

[pull] 0.x from laravel:0.x#83

Merged
pull[bot] merged 1 commit into
HinchK:0.xfrom
laravel:0.x
Jul 18, 2026
Merged

[pull] 0.x from laravel:0.x#83
pull[bot] merged 1 commit into
HinchK:0.xfrom
laravel:0.x

Conversation

@pull

@pull pull Bot commented Jul 18, 2026

Copy link
Copy Markdown

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 : )

* 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>
@pull pull Bot locked and limited conversation to collaborators Jul 18, 2026
@pull pull Bot added the ⤵️ pull label Jul 18, 2026
@pull
pull Bot merged commit a1b3ce7 into HinchK:0.x Jul 18, 2026
9 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant