Skip to content

Pivot table on ManyToMany relationships #89

@CSenshi

Description

@CSenshi

First Thing First... Great Package! 💯

Now about issue: When you have ManyToMany relationship (via belongsToMany) and try to generate diagram, it will include pivot table in diagram, but without proper naming. It will be called 'Pivot'.

For Example: below I have included 2 classes that are connected via M:M relationship and they both have pivot table name (buyer_seller) included in their relationship but on the diagram it still shows table as 'Pivot'.

  • Classes:
    •  class Buyer extends Model
       {
           public function buyer()
           {
               return $this->belongsToMany(Seller::class, 'buyer_seller');
           }
       }
    •   class Seller extends Model
        {
            public function buyer()
            {
                return $this->belongsToMany(Buyer::class, 'buyer_seller');
            }
        }
  • Diagram:
    Screenshot from 2020-11-23 01-52-11

P.S. I don't know if it's my fault or not, but as far as I have read documentation there is nothing written about this exact case. So it would be nice to have feature to enable pivot table naming in diagram.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions