Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

loco88's avatar

BelongsToMany relations with pivot

Hi I have a problem with BelongToMany relationship, to be honest I know, I can find package what will resolve my problem (this case) but I prefer to understand this case.

In my case its simple relations blog post -> tags First I have table posts and tags

I have also additional pivot table posts_tags where I try to store relations. In this table, I have only 2 fields (tag_id, post_id)

In Eloquent model, I create a relation and its works correctly :)

But now its question how to create a good relation in laravel NOVA, And here im stock, I truly don't understand how it should works how to attach relations via laravel nova

0 likes
1 reply

Please or to participate in this conversation.