Replies: 3 comments 2 replies
-
Feel free to submit a PR that fixes this. |
Beta Was this translation helpful? Give feedback.
-
Has any progress been made on this? I have a similar pivot table that does not generate any |
Beta Was this translation helpful? Give feedback.
-
For anyone looking for how to make this work appropriately (and future me), the trick is overriding the public function buildSortQuery(): Builder
{
return static::query()
->where('lesson_id', $this->lesson_id);
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there.
I have a many-to-many polymorphic relationship with dedicated pivot model, that pivot model extends
Illuminate\Database\Eloquent\Relations\MorphPivot
as described in the Laravel Docs.Thing is, it always sets value of
1
to the sortable column on any new pivot record I create. Same when:Skillable::factory()->create()
multiple timesSkillable::factory()->count(N)->create()
Skillable::create($attrs)
BTW using the Sortable trait and it works as it should on few other regular eloquent modals.
Beta Was this translation helpful? Give feedback.
All reactions