Laravel-Backpack / community-forum

A workspace to discuss improvement and feature ideas, before they're actually implemented.
28 stars 0 forks source link

[Feature] Support using Models as pivot tables #195

Open tabacitu opened 2 years ago

tabacitu commented 2 years ago

Bug report

What I did

Added Hero to the demo, which should be using monsters as the pivot table. The idea was that... if Monster were a pivot table... we would be able to test ALL field types, if they work as pivot fields.

That would help us fill in the last column in this table.

What I expected to happen

Create / Update pages to load.

What happened

Screenshot 2022-02-02 at 20 19 32

What I've already tried to fix it

Nothing yet, since this is not exactly urgent. We can add this later, as a feature. I think what fields we support right now as pivot subfields are already MORE than enough for most projects.

Basically, what I think we need to do is:

Is it a bug in the latest version of Backpack?

v4.2/v5 - whatever you wanna call it

tabacitu commented 2 years ago

Note - until this is done, people can still use fields that do NOT represent a relationship on a Model. Like... select_from_array and select2_from_array.

tabacitu commented 2 years ago

@pxpm this has come up in https://stackoverflow.com/questions/72793952/many-to-many-column-not-found-issue-in-subfield-relationships

How difficult do you think this would be to implement - where would we need changes?

pxpm commented 2 years ago

@tabacitu What does not work is repeatable over repeatable, but using selects it works: https://recordit.co/SuEWKUAAoR

kasperbjerby commented 2 years ago

If we could use a model as a pivot table, would that also allow us to add "RevisionableTrait" to it and set things like "touches"? Cause as of right now, i don't see how i can update the parents "updated_at" when something changes in the pivot table and i also can't see the changes in the revisions view.. Would this maybe allow for that?