MorphMany Relation buggy in relationshipManager.

I have discovered a problem and am not sure whether I am doing something wrong or it's a bug. After hours of trying, I still can't find a solution. The following initial situation. I have a Vehicle Model with a MorphTo relation:
public function Owner(): MorphTo
{
return $this->morphTo();
}
public function Owner(): MorphTo
{
return $this->morphTo();
}
Then a Customer Model with a MorphMany relation:
public function Vehicles(): MorphMany
{
return $this->morphMany(Vehicle::class, 'Owner');
}
public function Vehicles(): MorphMany
{
return $this->morphMany(Vehicle::class, 'Owner');
}
And a Carrier Model with a MorphMany relation:
public function Vehicles(): MorphMany
{
return $this->morphMany(Vehicle::class, 'owner');
}
public function Vehicles(): MorphMany
{
return $this->morphMany(Vehicle::class, 'owner');
}
Both should be able to own several Vehicles. Now, I inserted a RelationManager in my Customer Resource which should allow vehicles to be associated and removed on the Edit Page. Assignment of the first vehicle still works quite normally. As soon as I want to assign another one, the Select Box is empty and no more vehicles are displayed for assignment.
5 Replies
core
core10mo ago
did you use associate action?
DevRaeph
DevRaephOP10mo ago
Of course
core
core10mo ago
How is your select component like?
DevRaeph
DevRaephOP10mo ago
Its the default one from the the associate action, nothing modified, as i said, the first one works perfectly after that, the action selection is empty
DevRaeph
DevRaephOP10mo ago
GitHub
GitHub - DevRaeph/filament-morph-many-relation
Contribute to DevRaeph/filament-morph-many-relation development by creating an account on GitHub.
Want results from more Discord servers?
Add your server