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

fix: Fixing issue when using a different table to store pivot data #492

Conversation

jordanmiguel
Copy link
Contributor

This fixes an issue when you use a different table name to store pivot data between tags and taggables.

Let's say you use "lorem_tags" to store tags, and "lorem_tag_model" to store pivot data, and on pivot table you have "tag_id, model_id, model_type", when you set on config:

    'taggable' => [
        'table_name' => 'lorem_tag_model',
        'morph_name' => 'model',
    ]

It'll look for the models table to check the pivot instead of lorem_tag_model

@freekmurze freekmurze merged commit 6275878 into spatie:main Jan 19, 2024
17 checks passed
@freekmurze
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants