Support the ongoing development of Laravel.io →
Eloquent Architecture

I have a post table and that post may be included in multiple sections so now I have 3 tables:

  • posts
  • post_section
  • sections

If i am not mistaken this is a many-to-many relationship right? and I could just follow laravels roles, role_user, users example and I'll get it working. The problem is my post_section table has an extra is_main field and it determines the main section for my post which I use most of the time. How can I retrieve the is_main in the post_section table?

Thanks!

Last updated 3 years ago.
0

@AnasT Thanks! I can't believe I missed that one! :D

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.