CRUD icon indicating copy to clipboard operation
CRUD copied to clipboard

[Feature] Support using Models as pivot tables

Open tabacitu opened this issue 3 years ago • 4 comments

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:

  • create a new MonsterPivot model, that extends Illuminate\Database\Eloquent\Relations\Pivot.. or better yet, just has those few methods and properties on it and extends Monster;
  • make sure Monster has all relationships it needs;
  • test all relationship fields, that they work as pivot subfields;

Is it a bug in the latest version of Backpack?

v4.2/v5 - whatever you wanna call it

tabacitu avatar Feb 02 '22 18:02 tabacitu