select columns from eager loaded tables

Posted 1 year ago by disto

Hi, I have the following query which works well but I only need some columns (article_id, price) from the last (articles) loaded table. How do I do this? This is the query:

$result = OrderRelation::where('relation_id', $relation_id)->with('order.order_lines.articles)->get()

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


Reply to

Use Markdown with GitHub-flavored code blocks.