Support the ongoing development of Laravel.io →
Database Eloquent

I'm trying to get a Post inside a Session, but between Post and Session I have a Category Model. Each Session have many Categories that have many Posts (Posts can have same 'slug', therefore i need pass session_id on Eloquent query.) How can I do it?

Last updated 3 years ago.
0

If you mean getting all "posts" related to a "session", given the session id, than this may help you (similar situation):
http://laravel.io/forum/02-12-2014-chaining-hasmany-relationships

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.