You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Associate and Dissociate actions don't work with a MorphMany relationship. I got an error :
I have 3 models : Client, Entreprise and Interlocuteur.
Relations between them are :
Client : public function interlocuteurs(): MorphMany { return $this->morphMany(Interlocuteur::class, 'interlocuteurable'); }
Entreprise : public function interlocuteurs(): MorphMany { return $this->morphMany(Interlocuteur::class, 'interlocuteurable'); }
Interlocuteur : public function interlocuteurable(): MorphTo { return $this->morphTo(); }
Expected behavior
The record should be dettached from the Client or Entreprise.
Steps to reproduce
Create a user
Create a Client record
Create a Entreprise record
Create an interlocuteur attached to a Client or a Entreprise
Try to dissociate the Interlocuteur
Reproduction repository (issue will be closed if this is not valid)
Package
filament/filament
Package Version
v3.2.117
Laravel Version
v11.27.2
Livewire Version
No response
PHP Version
php 8.2
Problem description
Associate and Dissociate actions don't work with a MorphMany relationship. I got an error :


I have 3 models : Client, Entreprise and Interlocuteur.
Relations between them are :
Client :
public function interlocuteurs(): MorphMany { return $this->morphMany(Interlocuteur::class, 'interlocuteurable'); }
Entreprise :
public function interlocuteurs(): MorphMany { return $this->morphMany(Interlocuteur::class, 'interlocuteurable'); }
Interlocuteur :
public function interlocuteurable(): MorphTo { return $this->morphTo(); }
Expected behavior
The record should be dettached from the Client or Entreprise.
Steps to reproduce
Create a user
Create a Client record
Create a Entreprise record
Create an interlocuteur attached to a Client or a Entreprise
Try to dissociate the Interlocuteur
Reproduction repository (issue will be closed if this is not valid)
https://github.com/rfiette/FilamentMorphBug2
Relevant log output
No response
The text was updated successfully, but these errors were encountered: