Edgy

Eloquent Relationship or Query Builder for 3 relational tables?

Posted 11 months ago by Edgy

Hi guys, I have 3 tables namely, workers_messages jobs and employers under workers_message have jobs_idcolumn. while jobs have employers_id .

I am creating like a inbox page, so I am the employer and I will get the records from workers_message. The relation is simple: workers_message.jobs_id -> jobs.employers_id -> employers

My question is, it is recommended to code this with Eloquent:Relationship? or Query Builder (like Inner Join)? I will expect to receive like 100 messages per jobs, which are recommended? Thanks

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.