Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom pivot models #23

Open
SlyDave opened this issue Mar 9, 2020 · 1 comment
Open

Support custom pivot models #23

SlyDave opened this issue Mar 9, 2020 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@SlyDave
Copy link

SlyDave commented Mar 9, 2020

Custom Pivot models are being included as standard models

image

(likely because they ultimately extend Model::class)

Relations that actually use these Custom model classes aren't noted as such
image

The above is an example of

    public function vessels(): BelongsToMany
    {
        return $this->belongsToMany(Vessel::class, 'users_vessels')->using(UserVesselPivot::class);
    }

I think if a class is of Pivot::class it can be ignored for layout. But as the Pivot class has its own fillable etc for use with withPivot() it could also be creatable via this package when defining relations - maybe an "Add Custom Pivot Class" option then provide the same model creation interface that already exists.

@SlyDave SlyDave changed the title Support custom pivot models Support custom pivot classes Mar 9, 2020
@SlyDave SlyDave changed the title Support custom pivot classes Support custom pivot models Mar 9, 2020
@mtolhuys mtolhuys added the enhancement New feature or request label Mar 9, 2020
@mtolhuys mtolhuys added this to the v1.0.1 milestone Mar 9, 2020
@dedobbin
Copy link

I'm giving it a shot to implement this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants